-
Notifications
You must be signed in to change notification settings - Fork 138
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
Add Support for Nested Function in Order By Clause #1789
Add Support for Nested Function in Order By Clause #1789
Conversation
* Adding order by clause support for nested function. Signed-off-by: forestmvey <[email protected]> * Adding test coverage for nested in ORDER BY clause. Signed-off-by: forestmvey <[email protected]> * Added nested function validation to NestedAnalyzer. Signed-off-by: forestmvey <[email protected]> --------- Signed-off-by: forestmvey <[email protected]>
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.
|
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.
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) { |
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.
do we also need to check for size() < 1
?
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.
Yes I'll add this check and a relevant test too.
} | ||
|
||
@Test | ||
void nested_with_invalid_arg_type_throws_exception() { |
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.
do we want to add a test case to validate that nested()
returns an IllegalArgumentException?
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.
Already have one here
Signed-off-by: forestmvey <[email protected]>
de77277
* Add Support for Nested Function in Order By Clause (#280) * Adding order by clause support for nested function. Signed-off-by: forestmvey <[email protected]> * Adding test coverage for nested in ORDER BY clause. Signed-off-by: forestmvey <[email protected]> * Added nested function validation to NestedAnalyzer. Signed-off-by: forestmvey <[email protected]> --------- Signed-off-by: forestmvey <[email protected]> * Adding semantic check for missing arguments in function and unit test. Signed-off-by: forestmvey <[email protected]> --------- Signed-off-by: forestmvey <[email protected]> (cherry picked from commit 3302ec8)
* Add Support for Nested Function in Order By Clause (#280) * Adding order by clause support for nested function. Signed-off-by: forestmvey <[email protected]> * Adding test coverage for nested in ORDER BY clause. Signed-off-by: forestmvey <[email protected]> * Added nested function validation to NestedAnalyzer. Signed-off-by: forestmvey <[email protected]> --------- Signed-off-by: forestmvey <[email protected]> * Adding semantic check for missing arguments in function and unit test. Signed-off-by: forestmvey <[email protected]> --------- Signed-off-by: forestmvey <[email protected]> (cherry picked from commit 3302ec8)
* Add Support for Nested Function in Order By Clause (#280) * Adding order by clause support for nested function. Signed-off-by: forestmvey <[email protected]> * Adding test coverage for nested in ORDER BY clause. Signed-off-by: forestmvey <[email protected]> * Added nested function validation to NestedAnalyzer. Signed-off-by: forestmvey <[email protected]> --------- Signed-off-by: forestmvey <[email protected]> * Adding semantic check for missing arguments in function and unit test. Signed-off-by: forestmvey <[email protected]> --------- Signed-off-by: forestmvey <[email protected]> (cherry picked from commit 3302ec8) Co-authored-by: Forest Vey <[email protected]>
Description
Add support for nested function use in the
ORDER BY
clause.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.