-
Notifications
You must be signed in to change notification settings - Fork 141
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
Pagination Phase 2: Support WHERE
clause, column list in SELECT
clause and for functions and expressions in the query.
#1500
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1500 +/- ##
============================================
+ Coverage 97.27% 97.32% +0.04%
- Complexity 4330 4418 +88
============================================
Files 388 388
Lines 10807 10976 +169
Branches 761 775 +14
============================================
+ Hits 10513 10682 +169
Misses 287 287
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more.
|
117e889
to
899d083
Compare
4b995b7
to
4f6da54
Compare
// SELECT max(age) OVER (PARTITION BY city) ... | ||
var projections = node.getProjectList(); | ||
if (projections.size() != 1) { | ||
public Boolean visitSort(Sort node, Object context) { |
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.
Would it be better to override the defaultResult
instead of returning Boolean.FALSE
for all unsupported nodes?
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.
Or on the flip side, you could make the defaultResult
Boolean.TRUE
so that you don't have make duplicated canPaginate(node, context)
calls. Doing this can eliminate canPaginate
and would use the default visitor of the AbstractNodeVisitor as it traverses through it's children anyways.
core/src/test/java/org/opensearch/sql/planner/DefaultImplementorTest.java
Outdated
Show resolved
Hide resolved
Queries with aliases seem to be falling back to legacy. |
@GumpacG, There is a syntax issue. Correct one is |
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
@@ -17,6 +17,7 @@ | |||
import java.io.IOException; | |||
import org.json.JSONObject; | |||
import org.junit.Assert; | |||
import org.junit.Ignore; |
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.
Probably missed this.
|
||
// Queries with LIMIT clause are not supported | ||
@Override | ||
public Boolean visitLimit(Limit node, Object context) { |
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.
What's the point of having these explicit cases for what isn't supported if it will return false without the override. Perhaps we should log something stating the feature is unsupported. Maybe add a TODO comment for future work.
Signed-off-by: Yury-Fridlyand <[email protected]>
WHERE
clause, column list in SELECT
clause and for functions and expressions in the query.WHERE
clause, column list in SELECT
clause and for functions and expressions in the query.
CI fails on BWC, ignoring it for now. |
…lause and for functions and expressions in the query. (#1500) * Add support for `WHERE` clause, column list in `SELECT` clause and for functions and expressions in the query. Signed-off-by: Yury-Fridlyand <[email protected]> * Fix merge issue and address PR feedback by updating comments. Signed-off-by: Yury-Fridlyand <[email protected]> * More comments. Signed-off-by: Yury-Fridlyand <[email protected]> * Add extra check for unset `initialSearchRequest`. Signed-off-by: Yury-Fridlyand <[email protected]> --------- Signed-off-by: Yury-Fridlyand <[email protected]> (cherry picked from commit da386e5)
…lause and for functions and expressions in the query. (#1500) (#1741) * Add support for `WHERE` clause, column list in `SELECT` clause and for functions and expressions in the query. Signed-off-by: Yury-Fridlyand <[email protected]> * Fix merge issue and address PR feedback by updating comments. Signed-off-by: Yury-Fridlyand <[email protected]> * More comments. Signed-off-by: Yury-Fridlyand <[email protected]> * Add extra check for unset `initialSearchRequest`. Signed-off-by: Yury-Fridlyand <[email protected]> --------- Signed-off-by: Yury-Fridlyand <[email protected]> (cherry picked from commit da386e5) Co-authored-by: Yury-Fridlyand <[email protected]>
Pagination in V2: Phase 2. See Phase 1 in #1497.
Doc: https://github.com/Bit-Quill/opensearch-project-sql/blob/61767f2b200b2a7f8c8b2df32de209b3c30caa61/docs/dev/Pagination-v2.md
You can use attached script for testing as well. Command line:
./cursor_test.sh <table> <page size>
. Requiresjq
. Rename the script before use.cursor_test.sh.txt
Description
Add support for more complex queries in paged requests.
Supported things:
WHERE
clauseHAVING
clauseSELECT
clauseSELECT
andWHERE
:IN
,BETWEEN
,CASE .. WHEN ..
highlight
)_id
,_score
, etcUnsupported things:
SHOW
andDESCRIBE
NESTED
functionmin
,max
OVER
Issues Resolved
Full support of
SELECT
clause and supportWHERE
clause, including functions and expressions.DEMO
Pagination.with.WHERE.clause.mp4
TODOs:
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.