Skip to content

[FEATURE] Unify PPL Calcite V3 processing via unified query API #5068

Description

@dai-chen

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:

  1. Unified Planning: QueryService should delegate Calcite planning to UnifiedQueryPlanner instead of duplicating the AST-to-RelNode conversion and collation preservation logic.
  2. Unified Context: QueryService should use UnifiedQueryContext (or share its context-building logic) instead of maintaining separate FrameworkConfig construction.
  3. Unified Execution: OpenSearchExecutionEngine should leverage UnifiedQueryCompiler for 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()

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestmaintenanceImproves code quality, but not the product

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions