Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Columns (fields) with dot in the name are processed incorrectly #1784

Open
Yury-Fridlyand opened this issue Jun 26, 2023 · 2 comments
Open
Labels
bi-tooling bug Something isn't working PPL Piped processing language Priority-High SQL

Comments

@Yury-Fridlyand
Copy link
Collaborator

Yury-Fridlyand commented Jun 26, 2023

What is the bug?
See examples below

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Create a doc with a dot in a field name:
curl -X POST "localhost:9200/test/_doc/?pretty" -H 'Content-Type: application/json' -d '{ "account.number" : 42 }'
  1. Query index:
select * from test

or PPL:

source=test
  1. Response:
    SQL:
{
    "schema": [
        {
            "name": "account",
            "type": "object"
        }
    ],
    "datarows": [
        [
            null
        ]
    ],
    "total": 1,
    "size": 1,
    "status": 200
}

PPL:

{
    "schema": [
        {
            "name": "account",
            "type": "struct"
        }
    ],
    "datarows": [
        [
            null
        ]
    ],
    "total": 1,
    "size": 1
}

Or as a table

+-----------+
| account   |
|-----------|
| null      |
+-----------+

Specifying exact column name works fine though

What is the expected behavior?
Plugin should process dots in column names correctly.

+------------------+
| account.number   |
|------------------|
| 42               |
+------------------+

What is your host/environment?
main @ 34cad6e

Do you have any screenshots?
N/A

Do you have any additional context?
N/A

@Yury-Fridlyand Yury-Fridlyand added bug Something isn't working untriaged SQL PPL Piped processing language and removed untriaged labels Jun 26, 2023
@forestmvey
Copy link
Collaborator

Is a bug on the OpenSearch side. Not a valid use-case for SQL plugin to handle and so I think this can be closed!

8748

@MaxKsyunz
Copy link
Collaborator

MaxKsyunz commented Jul 31, 2023

FYI this works ok to access properties of object fields.

If the mapping for field resource is object and it has a property called service.name, then select resource.service.name from ss4o_traces-default-namespace limit 1 will return the correct value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bi-tooling bug Something isn't working PPL Piped processing language Priority-High SQL
Projects
None yet
Development

No branches or pull requests

4 participants