opensearch-project / opensearch-project/sql
[BUG] Analyzer should report error for mismatch between select and group by items
@dai-chen is already working on this.
Since Dec 14, 2022.
- Dominant language
- Java
- Stars
- 176
- Forks
- 229
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 43
Description
What is the bug?
Analyzer does not report a SemanticCheckException when there is a mismatch between select and group by items.
How can one reproduce the bug?
Steps to reproduce the behavior:
- Query
SELECT str0 FROM calcs GROUP BY str1;
What is the expected behavior?
A SemanticCheckException should be thrown with the message "Expression [str0] that contains non-aggregated column is not present in group by clause" as shown in the test should_report_error_for_mismatch_between_select_and_group_by_items in https://github.com/opensearch-project/sql/blob/2.x/sql/src/test/java/org/opensearch/sql/sql/parser/AstAggregationBuilderTest.java.
What is your host/environment?
- OS: macOS
- Version: OpenSearch 2.x
Do you have any additional context?
The test should be enabled once this has been fixed/implemented.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.