[Feature][PPL] Apply Calcite post-processing to pushed aggregation snapshots

Open
#5,800 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
java

Research direction

The issue involves modifying the query engine's physical plan processing for pushed aggregations with Calcite operators. Start by examining the optimized physical plan detection logic and the StateStoreScan integration. Look for existing tests related to pushed aggregation and StateStore to understand the codebase. The goal is to compile a residual Calcite plan for reuse without restarting the primary query.

Written by the indexing model from the issue text.

Description

aggregation async calcite enhancement PPL

Parent: #5765

Goal

Return current results when an eligible pushed aggregation has Calcite operators above the aggregation leaf.

Scope

  • Detect the eligible pushed aggregation leaf from the optimized physical plan.
  • Store aggregation-boundary rows with REPLACE semantics.
  • Replace the aggregation leaf with a StateStoreScan for current-result evaluation.
  • Compile the residual Calcite plan once and reuse it for subsequent POST timeout and GET reads.
  • Do not reparse, reoptimize, or restart the primary query during polling.

Acceptance criteria

  • Queries such as pushed stats followed by partial-safe eval or fields can return meaningful current results.
  • Every read evaluates the cached residual plan against one coherent StateStore view.
  • The primary query still executes once and remains the authoritative final path.
  • Final output exactly matches synchronous Calcite PPL output.
  • Ambiguous or unsupported physical shapes fail classification safely and do not publish semantically invalid rows.
  • Concurrent StateStore replacement, preview evaluation, cancellation, and close are covered by tests.
Dominant language
Java
Stars
176
Forks
237
Avg merge
2d 12h
Merged PRs (30d)
34

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from opensearch-project/sql

All issues in opensearch-project/sql

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.