-
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: Provide null-safe scripts for Not and Neg #34877
Conversation
Introduce null-safe Painless scripts for Not and Neg Simplify script generation for Unary functions Close elastic#34848
Pinging @elastic/es-search-aggs |
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
@@ -456,6 +456,13 @@ selectHireDateGroupByHireDate | |||
SELECT hire_date HD, COUNT(*) c FROM test_emp GROUP BY hire_date ORDER BY hire_date DESC; | |||
selectSalaryGroupBySalary | |||
SELECT salary, COUNT(*) c FROM test_emp GROUP BY salary ORDER BY salary DESC; | |||
selectSalaryGroupBySalaryHavingIsNotNull | |||
SELECT salary, COUNT(*) c FROM test_emp GROUP BY salary HAVING MAX(languages) IS NOT NULL ORDER BY salary DESC; |
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.
This is a good test atm, but not really testing the behavior as MAX() doesn't seem to return null
in any scenario #34896
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.
Good catch - due the use of primitives, a non-null value is returned all the time.
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 question
} | ||
|
||
if (!(input instanceof Boolean)) { | ||
throw new SqlIllegalArgumentException("A boolean is required; received {}", input); |
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.
Shouldn't this already be caught by the pipeline? Is it just a "safety net" ?
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.
It is yes - we might not need them long term.
* master: Introduce cross-cluster replication API docs (elastic#34726) Responses can use Writeable.Reader interface (elastic#34655) SQL: Provide null-safe scripts for Not and Neg (elastic#34877) Fix put/resume follow request parsing (elastic#34913) Fix line length for org.elasticsearch.common.* files (elastic#34888) [ML] Extract common native process base class (elastic#34856) Refactor children aggregator into a generic ParentJoinAggregator (elastic#34845) [Style] Fix line lengths in action.admin.indices (elastic#34890) HLRC - add support for source exists API (elastic#34519)
Introduce null-safe Painless scripts for Not and Neg Simplify script generation for Unary functions Close #34848
Introduce null-safe Painless scripts for Not and Neg
Simplify script generation for Unary functions
Close #34848