Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Error when combining Select, Order by and Group by on a String field #1143

Open
awongc opened this issue Nov 9, 2021 · 1 comment
Open

Comments

@awongc
Copy link

awongc commented Nov 9, 2021

Hi,

I have been trying to run a simple query using select, order by and group by on a String field but it keeps throwing error

This is what I'm running:
PUT _opendistro/_sql/settings
{
"query": "SELECT StringField AS StringField FROM Index GROUP BY StringField ORDER BY StringField"
}

And I'm getting the following error

{
"error": {
"reason": "There was internal problem at backend",
"details": "invalid value operation on MISSING_VALUE",
"type": "IllegalStateException"
},
"status": 500
}

I have no issues if I remove the field of the select statement and use * instead
"SELECT * FROM Index GROUP BY StringField ORDER BY StringField"

Also just by removing any of the group or, order by part of the statement also allow it to work properly.
example:
"SELECT StringField AS StringField FROM Index GROUP BY StringField"
"SELECT StringField AS StringField FROM Index ORDER BY StringField"

I have the new engine enable
PUT /_opendistro/_sql/settings { "transient" : { "opendistro.sql.engine.new.enabled" : "true" } }

Any thoughts on why this isn't working?

@lazpuzzle
Copy link

i have issue like you if you have a answer please tell me too thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants