You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the bug?
Invalid aggregation statement could be executed and return meaningless outcome. Further more, if the statement fallback to legacy engine, more confused error will be thrown. A use case reported in #2320
How can one reproduce the bug?
PUT test_index1/_doc/1
{
"name": "Tom",
"id" : 1
}
POST /_plugins/_sql
{
"query": "SELECT id FROM test_index1 GROUP BY name"
}
Return null
What is the expected behavior?
An SemanticCheckException exception is thrown.
For instance,
Spark throws
[MISSING_AGGREGATION] The non-aggregating expression "id" is based on columns which are not participating in the GROUP BY clause.
Add the columns or the expression to the GROUP BY, aggregate the expression, or use "any_value(id)" if you do not care which of the values within a group is returned.;
PostgreSQL throws
Error in query: ERROR: column "test_index1.id" must appear in the GROUP BY clause or be used in an aggregate function
What is your host/environment?
Version 2.15
Plugins SQL
Do you have any screenshots?
If applicable, add screenshots to help explain your problem.
Do you have any additional context?
Add any other context about the problem.
The text was updated successfully, but these errors were encountered:
LantaoJin
changed the title
[BUG] Invalid aggregation statement should throw SyntaxAnalysisException
[BUG] Invalid aggregation statement should throw SemanticCheckException
Jun 19, 2024
What is the bug?
Invalid aggregation statement could be executed and return meaningless outcome. Further more, if the statement fallback to legacy engine, more confused error will be thrown. A use case reported in #2320
How can one reproduce the bug?
Return
null
What is the expected behavior?
An
SemanticCheckException
exception is thrown.For instance,
Spark throws
PostgreSQL throws
What is your host/environment?
Do you have any screenshots?
If applicable, add screenshots to help explain your problem.
Do you have any additional context?
Add any other context about the problem.
The text was updated successfully, but these errors were encountered: