Add Calcite native SQL planning in UnifiedQueryPlanner#5257
Add Calcite native SQL planning in UnifiedQueryPlanner#5257dai-chen wants to merge 4 commits intoopensearch-project:mainfrom
Conversation
PR Reviewer Guide 🔍(Review updated until commit dbde012)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to dbde012 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 2cd1e28
Suggestions up to commit 6bf098d
Suggestions up to commit 5cd723f
Suggestions up to commit 0ff9947
|
0ff9947 to
5cd723f
Compare
|
Persistent review updated to latest commit 5cd723f |
5cd723f to
6bf098d
Compare
|
Persistent review updated to latest commit 6bf098d |
6bf098d to
2cd1e28
Compare
|
Persistent review updated to latest commit 2cd1e28 |
Add SQL support to the unified query API using Calcite's native parser pipeline (SqlParser → SqlValidator → SqlToRelConverter → RelNode), bypassing the ANTLR parser used by PPL. Changes: - UnifiedQueryPlanner: use PlanningStrategy to dispatch CalciteSqlStrategy vs AstStrategy with no conditionals in plan() - CalciteSqlStrategy: Calcite Planner with try-with-resources for ANSI SQL - AstStrategy: ANTLR-based path for PPL (and future SQL V2) - UnifiedQueryContext: SqlParser.Config with Casing.UNCHANGED to preserve lowercase OpenSearch index names Signed-off-by: Chen Dai <daichen@amazon.com>
…guage support - Refactor UnifiedQueryTestBase with queryType() hook for subclass override - Add UnifiedSqlQueryPlannerTest covering SELECT, WHERE, GROUP BY, JOIN, ORDER BY, subquery, case sensitivity, namespaces, and error handling - Update UnifiedQueryContextTest to verify SQL context creation Signed-off-by: Chen Dai <daichen@amazon.com>
Add language (PPL/SQL) and queryPattern param dimensions for side-by-side comparison of equivalent queries across both languages. Remove separate UnifiedSqlQueryBenchmark in favor of unified class. Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
2cd1e28 to
dbde012
Compare
|
Persistent review updated to latest commit dbde012 |
Description
Adds SQL support to the unified query API using Calcite's native parser pipeline, enabling ANSI SQL queries to produce RelNode logical plans alongside the existing PPL path. Specifically, SQL planning path:
SqlParser→SqlValidator→SqlToRelConverter→RelNode.Next Steps
UnifiedQueryParserto decouple parsing from planningRelated Issues
Resolves #5248 (subtask 1)
Check List
--signoffor-s.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.