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

SQL: wrong number of values for columns #41811

Closed
bpintea opened this issue May 3, 2019 · 4 comments
Closed

SQL: wrong number of values for columns #41811

bpintea opened this issue May 3, 2019 · 4 comments
Labels

Comments

@bpintea
Copy link
Contributor

bpintea commented May 3, 2019

The queries that contain a duplicate column will only return once the value in a row.
Example:
select emp_no, first_name, emp_no from employees will return:

{"columns":[{"name":"emp_no","type":"text","display_size":2147483647},{"name":"first_name","type":"text","display_size":2147483647},{"name":"emp_no","type":"text","display_size":2147483647}],"rows":[["10001","Georgi"]]}
@bpintea bpintea added >bug :Analytics/SQL SQL querying labels May 3, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@astefan
Copy link
Contributor

astefan commented Sep 2, 2019

Just for the record, this issue manifests itself in a nastier way in case format=txt (as in /_sql?format=txt):

{
    "error": {
        "root_cause": [
            {
                "type": "index_out_of_bounds_exception",
                "reason": "Index 1 out of bounds for length 1"
            }
        ],
        "type": "index_out_of_bounds_exception",
        "reason": "Index 1 out of bounds for length 1"
    },
    "status": 500
}

@emasab thank you for providing the PR and apologies for the delay on looking at it. We plan on having a look and validate shortly.

@emasab
Copy link
Contributor

emasab commented Sep 2, 2019

@astefan you're welcome, I'm pleased to contribute

emasab added a commit to emasab/elasticsearch that referenced this issue Sep 25, 2019
@matriv matriv closed this as completed in 097ea36 Sep 30, 2019
matriv pushed a commit that referenced this issue Sep 30, 2019
Previously, if a column (field, scalar, alias) appeared more than once in the
SELECT list, the value was returned only once (1st appearance) in each row.

Fixes: #41811

(cherry picked from commit 097ea36)
matriv pushed a commit that referenced this issue Sep 30, 2019
Previously, if a column (field, scalar, alias) appeared more than once in the
SELECT list, the value was returned only once (1st appearance) in each row.

Fixes: #41811

(cherry picked from commit 097ea36)
matriv added a commit that referenced this issue Sep 30, 2019
Previously, if a column (field, scalar, alias) appeared more than once in the
SELECT list, the value was returned only once (1st appearance) in each row.

Fixes: #41811

(cherry picked from commit 097ea36)
@matriv
Copy link
Contributor

matriv commented Sep 30, 2019

master : 097ea36
7.x : 87156ad
7.4 : 79f1e53
7.3 : a63524b
6.8 : b3c4854

matriv pushed a commit that referenced this issue Sep 30, 2019
Previously, if a column (field, scalar, alias) appeared more than once in the
SELECT list, the value was returned only once (1st appearance) in each row.

Fixes: #41811

(cherry picked from commit 097ea36)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants