Skip to content
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

Document pagination design changes based on review feedback #1644

Conversation

MaxKsyunz
Copy link
Collaborator

This updates accounts for the following:

  1. Merge of OpenSearchIndexScan and OpenSearchPagedIndexScan, related builder classes and changes to logical plan optimization.
  2. Removal of ContinuePaginatedPlan and how initial and subsequent paged requests are expressed in logical query plan.
  3. Changes to OpenSearchIndexScan and OpenSearchScrollRequest necessary to support pagination.

MaxKsyunz added 2 commits May 19, 2023 03:28
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
@codecov
Copy link

codecov bot commented May 19, 2023

Codecov Report

Merging #1644 (5daad43) into feature/pagination/integ (8e624a5) will not change coverage.
The diff coverage is n/a.

@@                     Coverage Diff                     @@
##             feature/pagination/integ    #1644   +/-   ##
===========================================================
  Coverage                       97.23%   97.23%           
  Complexity                       4233     4233           
===========================================================
  Files                             387      387           
  Lines                           10628    10628           
  Branches                          721      721           
===========================================================
  Hits                            10334    10334           
  Misses                            287      287           
  Partials                            7        7           
Flag Coverage Δ
sql-engine 97.23% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Collaborator

@acarbonetto acarbonetto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - some minor comments/typos

@@ -7,15 +7,15 @@ A cursor is a SQL abstraction for pagination. A client can open a cursor, retrie
Currently, SQL plugin does not provide SQL cursor syntax. However, the SQL REST endpoint can return result a page at a time. This feature is used by JDBC and ODBC drivers.

# Scope
Currenty, V2 engine supports pagination only for simple `SELECT * FROM <table>` queries without any other clauses like `WHERE` or `ORDER BY`.
At this time, V2 engine supports pagination only for simple `SELECT * FROM <table>` queries without any other clauses like `WHERE` or `ORDER BY`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we're going to have update this line of the design each time we push a PR.
Maybe describe what the scope of this document contains. They will have to look at release notes and read issues to know what has actually been pushed to repo.

1. Execute paginated physical plan.
4. in OpenSearch data source:
1. Support pagination push down.
2. Support other push down optimizations with pagination.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about de-serialization and creating the cursor for the next requests?


### Query Plan Changes

All three kinds of requests &mdash; non-paged, initial page, or subsequent page &mdash; are processed in the same way. Simplified workflow of query plan processing is shown below for reference.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
All three kinds of requests &mdash; non-paged, initial page, or subsequent page &mdash; are processed in the same way. Simplified workflow of query plan processing is shown below for reference.
All three kinds of requests &mdash; non-paged, initial page, or subsequent page &mdash; are processed at a high-level in the same way. Simplified workflow of query plan processing is shown below for reference.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to say that all the requests go through the same high-level steps, although the details/execution of each step may differ.

docs/dev/Pagination-v2.md Outdated Show resolved Hide resolved
docs/dev/Pagination-v2.md Outdated Show resolved Hide resolved
docs/dev/Pagination-v2.md Outdated Show resolved Hide resolved

```mermaid
sequenceDiagram
participant PlanSerializer
participant ProjectOperator
participant ResourceMonitorPlan
participant OpenSearchPagedIndexScan
participant OpenSearchIndexScan
participant OpenSearchScrollRequest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a duplicate?

Suggested change
participant OpenSearchScrollRequest

docs/dev/Pagination-v2.md Outdated Show resolved Hide resolved
docs/dev/Pagination-v2.md Outdated Show resolved Hide resolved
docs/dev/Pagination-v2.md Outdated Show resolved Hide resolved
docs/dev/Pagination-v2.md Outdated Show resolved Hide resolved
Co-authored-by: Andrew Carbonetto <andrewc@bitquilltech.com>
Signed-off-by: Max Ksyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
@MaxKsyunz MaxKsyunz merged commit d30d44c into opensearch-project:feature/pagination/integ May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants