-
Notifications
You must be signed in to change notification settings - Fork 149
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
Support ppl BETWEEN operator within Calcite #3433
Support ppl BETWEEN operator within Calcite #3433
Conversation
Signed-off-by: Lantao Jin <[email protected]>
String expectedLogical = | ||
"" | ||
+ "LogicalProject(EMPNO=[$0], ENAME=[$1])\n" | ||
+ " LogicalFilter(condition=[SEARCH($7, Sarg[[20..30]])])\n" |
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.
Add tests for between 20 and 30.0
. Calcite has bug on Sarg: #3437, it may affect between as well.
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.
check testBetweenWithDifferentTypes2() in IT
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.
Shall we check the plan and final spark sql for that case as well? Seems we performs cast on the literal.
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.
sure, will add it.
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.
The cast is implicit actually:
source=EMP | where DEPTNO between 20 and 30.0 | fields EMPNO, ENAME
convert to
"SELECT `EMPNO`, `ENAME` FROM `scott`.`EMP` WHERE `DEPTNO` >= 2.00E1 AND `DEPTNO` <= 3.00E1"
JSONObject actual = | ||
executeQuery( | ||
String.format( | ||
"source=%s | where not age between 30 and 39 | fields firstname, age", |
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.
Shall we add test like "where not age not between 30 and 39"? Though I think it should work well.
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.
not necessary IMO. But no harm to add it as it's simply enough.
Signed-off-by: Lantao Jin <[email protected]>
1cefc8c
into
opensearch-project:feature/calcite-engine
Description
BETWEEN
operator within CalciteREGEXP
functionxor
operator issue.Related Issues
Resolves #3432
Check List
--signoff
.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.