Add Support for Nested Function in Order By Clause#1789
Merged
forestmvey merged 2 commits intoopensearch-project:mainfrom Jun 27, 2023
Merged
Add Support for Nested Function in Order By Clause#1789forestmvey merged 2 commits intoopensearch-project:mainfrom
forestmvey merged 2 commits intoopensearch-project:mainfrom
Conversation
* Adding order by clause support for nested function. Signed-off-by: forestmvey <forestv@bitquilltech.com> * Adding test coverage for nested in ORDER BY clause. Signed-off-by: forestmvey <forestv@bitquilltech.com> * Added nested function validation to NestedAnalyzer. Signed-off-by: forestmvey <forestv@bitquilltech.com> --------- Signed-off-by: forestmvey <forestv@bitquilltech.com>
554b55f to
84fab78
Compare
Codecov Report
@@ Coverage Diff @@
## main #1789 +/- ##
=========================================
Coverage 97.29% 97.29%
- Complexity 4408 4416 +8
=========================================
Files 388 388
Lines 10944 10960 +16
Branches 774 777 +3
=========================================
+ Hits 10648 10664 +16
Misses 289 289
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more.
|
acarbonetto
previously approved these changes
Jun 27, 2023
Collaborator
acarbonetto
left a comment
There was a problem hiding this comment.
Please add another check for empty nested call if that's possible.
Otherwise, we should add a parser test/check that fails to parse
| * @param nestedFunc Nested function expression. | ||
| */ | ||
| private void validateNestedArgs(FunctionExpression nestedFunc) { | ||
| if (nestedFunc.getArguments().size() > 2) { |
Collaborator
There was a problem hiding this comment.
do we also need to check for size() < 1?
Collaborator
Author
There was a problem hiding this comment.
Yes I'll add this check and a relevant test too.
| } | ||
|
|
||
| @Test | ||
| void nested_with_invalid_arg_type_throws_exception() { |
Collaborator
There was a problem hiding this comment.
do we want to add a test case to validate that nested() returns an IllegalArgumentException?
matthewryanwells
approved these changes
Jun 27, 2023
Yury-Fridlyand
previously approved these changes
Jun 27, 2023
GumpacG
previously approved these changes
Jun 27, 2023
Signed-off-by: forestmvey <forestv@bitquilltech.com>
de77277
MitchellGale
approved these changes
Jun 27, 2023
Yury-Fridlyand
approved these changes
Jun 27, 2023
GumpacG
approved these changes
Jun 27, 2023
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Jun 27, 2023
* Add Support for Nested Function in Order By Clause (#280) * Adding order by clause support for nested function. Signed-off-by: forestmvey <forestv@bitquilltech.com> * Adding test coverage for nested in ORDER BY clause. Signed-off-by: forestmvey <forestv@bitquilltech.com> * Added nested function validation to NestedAnalyzer. Signed-off-by: forestmvey <forestv@bitquilltech.com> --------- Signed-off-by: forestmvey <forestv@bitquilltech.com> * Adding semantic check for missing arguments in function and unit test. Signed-off-by: forestmvey <forestv@bitquilltech.com> --------- Signed-off-by: forestmvey <forestv@bitquilltech.com> (cherry picked from commit 3302ec8)
forestmvey
added a commit
that referenced
this pull request
Jun 27, 2023
* Add Support for Nested Function in Order By Clause (#280) * Adding order by clause support for nested function. Signed-off-by: forestmvey <forestv@bitquilltech.com> * Adding test coverage for nested in ORDER BY clause. Signed-off-by: forestmvey <forestv@bitquilltech.com> * Added nested function validation to NestedAnalyzer. Signed-off-by: forestmvey <forestv@bitquilltech.com> --------- Signed-off-by: forestmvey <forestv@bitquilltech.com> * Adding semantic check for missing arguments in function and unit test. Signed-off-by: forestmvey <forestv@bitquilltech.com> --------- Signed-off-by: forestmvey <forestv@bitquilltech.com> (cherry picked from commit 3302ec8)
forestmvey
added a commit
that referenced
this pull request
Jun 28, 2023
* Add Support for Nested Function in Order By Clause (#280) * Adding order by clause support for nested function. Signed-off-by: forestmvey <forestv@bitquilltech.com> * Adding test coverage for nested in ORDER BY clause. Signed-off-by: forestmvey <forestv@bitquilltech.com> * Added nested function validation to NestedAnalyzer. Signed-off-by: forestmvey <forestv@bitquilltech.com> --------- Signed-off-by: forestmvey <forestv@bitquilltech.com> * Adding semantic check for missing arguments in function and unit test. Signed-off-by: forestmvey <forestv@bitquilltech.com> --------- Signed-off-by: forestmvey <forestv@bitquilltech.com> (cherry picked from commit 3302ec8) Co-authored-by: Forest Vey <forestv@bitquilltech.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add support for nested function use in the
ORDER BYclause.Example Queries
Issues Resolved
Portion of Issue: 1111
Note this does not resolve issue 1777 but only bring V2 engine to parity with V1 engine.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.