opensearch-project / opensearch-project/sql
[FEATURE] Unify PPL Calcite V3 processing via unified query API
@dai-chen is already working on this.
Since Feb 3, 2026.
- Dominant language
- Java
- Stars
- 176
- Forks
- 229
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 43
Description
Is your feature request related to a problem?
The current PPL Calcite V3 execution path and the Unified Query API contain overlapping responsibilities with duplicated code and divergent implementations. Over time, this increases maintenance cost and creates a growing risk of behavioral drift across PPL execution paths.
As the long-term PPL specification reference implementation, the Unified Query API should become the single entrypoint and reusable library for any PPL implementor or adopter, including OpenSearch itself.
What solution would you like?
Refactor the PPL Calcite V3 execution path to reuse the Unified Query API components as the primary building blocks:
- Unified Planning:
QueryServiceshould delegate Calcite planning toUnifiedQueryPlannerinstead of duplicating the AST-to-RelNode conversion and collation preservation logic. - Unified Context:
QueryServiceshould useUnifiedQueryContext(or share its context-building logic) instead of maintaining separateFrameworkConfigconstruction. - Unified Execution:
OpenSearchExecutionEngineshould leverageUnifiedQueryCompilerfor plan compilation, or share a common execution abstraction.
As single source of truth, all Calcite-based execution flows (including UT/IT scaffolding and any shared base execution classes) should route through the same unified pipeline to ensure consistent behavior.
What alternatives have you considered?
- Keep separate implementations: Maintain both paths independently. This was rejected because it increases maintenance burden and risks behavioral divergence.
Do you have any additional context?
Current Architecture:
QueryService: UnresolvedPlan → CalcitePlanContext → CalciteRelNodeVisitor → RelNode
ExecutionEngine: RelNode → OpenSearchExecutionEngine.execute()
Target Architecture:
QueryService: UnresolvedPlan → UnifiedQueryPlanner → RelNode
ExecutionEngine: RelNode → UnifiedQueryCompiler → execute()
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.