You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/README.md
+55-1Lines changed: 55 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,21 @@ This module provides a high-level integration layer for the Calcite-based query
4
4
5
5
## Overview
6
6
7
-
The `UnifiedQueryPlanner` serves as the primary entry point for external consumers. It accepts PPL (Piped Processing Language) queries and returns Calcite `RelNode` logical plans as intermediate representation.
7
+
This module provides two primary components:
8
+
9
+
-**`UnifiedQueryPlanner`**: Accepts PPL (Piped Processing Language) queries and returns Calcite `RelNode` logical plans as intermediate representation.
10
+
-**`UnifiedQueryTranspiler`**: Converts Calcite logical plans (`RelNode`) into SQL strings for various target databases using different SQL dialects.
11
+
12
+
Together, these components enable a complete workflow: parse PPL queries into logical plans, then transpile those plans into target database SQL.
13
+
14
+
### Experimental API Design
15
+
16
+
**This API is currently experimental.** The design intentionally exposes Calcite abstractions (`Schema` for catalogs, `RelNode` as IR, `SqlDialect` for dialects) rather than creating custom wrapper interfaces. This is to avoid overdesign by leveraging the flexible Calcite interface in the short term. If a more abstracted API becomes necessary in the future, breaking changes may be introduced with the new abstraction layer.
8
17
9
18
## Usage
10
19
20
+
### UnifiedQueryPlanner
21
+
11
22
Use the declarative, fluent builder API to initialize the `UnifiedQueryPlanner`.
RelNode plan = planner.plan("source = opensearch.test");
22
33
```
23
34
35
+
### UnifiedQueryTranspiler
36
+
37
+
Use `UnifiedQueryTranspiler` to convert Calcite logical plans into SQL strings for target databases. The transpiler supports various SQL dialects through Calcite's `SqlDialect` interface.
0 commit comments