Commit 6177a52
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
- .kiro/specs/clickhouse-sql-dialect
- api
- src
- main/java/org/opensearch/sql/api/dialect
- test/java/org/opensearch/sql/api/dialect
- core
- src
- main/java/org/opensearch/sql/executor
- test/java/org/opensearch/sql/executor
- integ-test/src/test
- java/org/opensearch/sql/calcite/clickbench
- resources/clickbench/queries
- legacy
- src
- main/java/org/opensearch/sql/legacy/plugin
- test/java/org/opensearch/sql/legacy/plugin
- plugin
- src/main/java/org/opensearch/sql/plugin/config
- sql
- src
- main/java/org/opensearch/sql/sql
- dialect/clickhouse
- domain
- test/java/org/opensearch/sql/sql/dialect/clickhouse
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments