-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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: [Tests] Add integ tests for selecting a literal and an aggregate #42121
Conversation
Closes #41411 |
Pinging @elastic/es-search |
@elasticmachine test this please |
... otherwise this query was failing because the literal with this commit is supportedByAggsOnlyQuery
|
996302d
to
a8986fb
Compare
the latest commit fixes some integration tests that were failing. Pending to add more unit/integration tests, at the moment there is only one unit test for the issue that is addressing In a previous version that I've not sent I had left both supportedByAggsQuery and supportedByNoAggsQuery but given that the not aggregated fields inside an aggregation query are detected in the verification phase, another check should not be necessary. But if you want to maintain it, I could restore. The check was like:
in that case the ConstantInput was the only that was supportedByAggsQuery and supportedByNoAggsQuery. The integration tests were successful too with that approach. |
@elastic/es-sql Can someone look at this community PR? |
0bd8e98
to
4b2e482
Compare
rebased on current master |
4b2e482
to
17721c7
Compare
17721c7
to
311ff60
Compare
rebased |
311ff60
to
f5a07cc
Compare
rebased, some formatting and other integration tests |
788eefa
to
e683dc4
Compare
rebased |
Hi @emasab Apologies for the delay here. Since the merging of #49570 seems that the issue is solved. Thank you! |
Hi @matriv, happy to hear from you! I'm going to do that asap. Best |
@emasab Thank you! |
57e3436
to
26283b6
Compare
That's it! Only the tests are left and they're passing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, left a comment regarding the unit test.
@@ -430,4 +430,17 @@ public void testFoldingOfPivot() { | |||
assertThat(a, containsString("\"terms\":{\"field\":\"keyword\"")); | |||
assertThat(a, containsString("{\"avg\":{\"field\":\"int\"}")); | |||
} | |||
|
|||
public void testFoldingOfLiteralWithGroupBy() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this, as it's already added here:
Line 383 in 26283b6
p = plan("SELECT 1, count(*) FROM test GROUP BY int"); |
@astefan Could you please also take a look? |
26283b6
to
61a4700
Compare
@matriv I've removed the duplicated unit test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@elasticmachine ok to test |
@emasab Thanks a lot for your patience and your contribution! |
Add some more tests where more than one literal is selected, unaliased and aliased. Follows: elastic#42121
Add some more tests where more than one literal is selected, unaliased and aliased. Follows: #42121
No description provided.