Skip to content

Prototype progressive PPL query integration - #8

Open
penghuo wants to merge 2 commits into
feat/asyncquery-apifrom
feat/ppl-progressive-integration-prototype
Open

penghuo wants to merge 2 commits into
feat/asyncquery-apifrom
feat/ppl-progressive-integration-prototype

Conversation

@penghuo

@penghuo penghuo commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Purpose

Integration prototype for the reviewed PPL Async Query detail design. This PR is intentionally based on feat/asyncquery-api (PR #7) so the diff focuses on progressive result integration.

What this validates

  • Async jobs expose the complete result currently visible through ProgressiveQueryContext.
  • Non-blocking and composite execution publish root rows from ResultSet.next() into an append-only StateStore.
  • Non-composite pushed-down aggregation publishes partial-reduce state into a replace StateStore.
  • Pushed-down aggregation with Calcite post-processing compiles one cached preview plan whose aggregation leaf is replaced by StateStoreScan.
  • Final results still come from the primary query execution; polling never reruns the primary OpenSearch query.
  • Job lifecycle owns and closes the progressive context on delete, expiry, failure, or service shutdown.

Prototype-only choices

  • Partial-reduce cadence is forced with batched_reduce_size=2 to make reduce snapshots observable on small test clusters.
  • PPLProgressiveQueryPrototypeIT creates a large dataset and is a manual design-validation test, not a proposed permanent release test.
  • The physical-plan capture hook is a prototype seam and should be replaced by an explicit optimize/bind/codegen boundary in production code.

Validation

  • ./gradlew :opensearch-sql-plugin:test --tests 'org.opensearch.sql.plugin.transport.PPLAsyncQueryServiceTest' --tests 'org.opensearch.sql.plugin.transport.PPLAsyncQueryResponseFormatterTest'
  • ./gradlew :opensearch:compileJava :core:compileJava

Both passed locally.

Review focus

  1. ProgressiveQueryContextFactory: classification and StateStore/preview-plan construction.
  2. OpenSearchExecutionEngine.executeProgressively: optimize once, bind context, execute once.
  3. AggregationStatePublisher and AggregationResultMapper: reuse of the standard aggregation conversion path.
  4. PPLAsyncQueryService: lifecycle and concurrent reads of the current result.

@penghuo
penghuo requested a review from dai-chen as a code owner September 22, 2026 20:26
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.

1 participant