Skip to content

[Feature][PPL] Add async query lifecycle and ProgressiveQueryExecution contract #5796

Closed

Description

@penghuo

Parent: #5765

Goal

Add the asynchronous PPL API and establish the stable contract between the lifecycle and execution layers while preserving the existing synchronous Calcite PPL behavior.

Scope

  • Add asynchronous POST, GET, and DELETE behavior under /_plugins/_ppl.
  • Support wait_for_completion_timeout and keep_alive.
  • Implement owner-node routing, FGAC, capacity limits, retention, expiration, and cancellation.
  • Introduce ProgressiveQueryExecution with currentResult(), completion(), and idempotent close().
  • Make the job lifecycle own one ProgressiveQueryExecution instead of owning a terminal QueryResponse.
  • Materialize the current result outside the synchronized job state machine.
  • Support final-only execution until later tasks add progress and partial-result producers.

Acceptance criteria

  • Requests without asynchronous fields retain the existing synchronous behavior and response.
  • Fast success or failure returns without a job ID; timeout returns RUNNING with an opaque ID.
  • A successful final result is visible through currentResult() before completion() completes normally.
  • DELETE, expiration, shutdown, abort, and rejected late attachment close execution resources exactly once.
  • Timeout/completion, attachment/removal, GET/DELETE, routing, and authorization races are covered by tests.
  • Existing Calcite integration and YAML REST tests remain green.

Out of scope

Progress calculation, ResultSet row publication, aggregation reduce snapshots, and StateStore implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PPLasynccalciteenhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions