Skip to content

Commit 6177a52

Browse files
anirudhaAnirudha Jadhav
authored andcommitted
feat: Pluggable SQL dialect framework with ClickHouse dialect
Adds a pluggable SQL dialect framework to the OpenSearch SQL plugin's Calcite-based query engine, with ClickHouse as the first dialect. Framework: - DialectPlugin interface, DialectRegistry, QueryPreprocessor in api module - Dialect routing via ?dialect= query parameter on /_plugins/_sql - Integration with existing Calcite query pipeline ClickHouse dialect: - Query preprocessor strips FORMAT, SETTINGS, FINAL clauses - ClickHouseOperatorTable translates 25+ ClickHouse functions to Calcite equivalents (time-bucketing, type-conversion, aggregates, conditionals) - OpenSearchClickHouseSqlDialect for RelNode-to-SQL unparsing - Error handling with position info, function/type identification, safe 500s Testing: - 20 property-based tests (jqwik, 100 iterations each) - Unit tests for registry, routing, error handling - Integration tests (ClickHouseDialectIT) for end-to-end pipeline - 43 ClickBench SQL compatibility queries Signed-off-by: anirudha <anirudha@nyu.edu> Signed-off-by: Anirudha Jadhav <jadhanir@amazon.com>
1 parent e30b2f8 commit 6177a52

87 files changed

Lines changed: 5317 additions & 4 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"generationMode": "requirements-first"}

0 commit comments

Comments
 (0)