Skip to content

Commit e40e02a

Browse files
committed
docs(api): Update README to reflect SQL support in UnifiedQueryPlanner
Signed-off-by: Chen Dai <daichen@amazon.com>
1 parent 9c03e02 commit e40e02a

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

api/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This module provides components organized into two main areas aligned with the [
88

99
### Unified Language Specification
1010

11-
- **`UnifiedQueryPlanner`**: Accepts PPL (Piped Processing Language) queries and returns Calcite `RelNode` logical plans as intermediate representation.
11+
- **`UnifiedQueryPlanner`**: Accepts PPL (Piped Processing Language) or SQL queries and returns Calcite `RelNode` logical plans as intermediate representation.
1212
- **`UnifiedQueryTranspiler`**: Converts Calcite logical plans (`RelNode`) into SQL strings for various target databases using different SQL dialects.
1313

1414
### Unified Execution Runtime
@@ -17,7 +17,7 @@ This module provides components organized into two main areas aligned with the [
1717
- **`UnifiedFunction`**: Engine-agnostic function interface that enables functions to be evaluated across different execution engines without engine-specific code duplication.
1818
- **`UnifiedFunctionRepository`**: Repository for discovering and loading functions as `UnifiedFunction` instances, providing a bridge between function definitions and external execution engines.
1919

20-
Together, these components enable complete workflows: parse PPL queries into logical plans, transpile those plans into target database SQL, compile and execute queries directly, or export PPL functions for use in external execution engines.
20+
Together, these components enable complete workflows: parse PPL or SQL queries into logical plans, transpile those plans into target database SQL, compile and execute queries directly, or export PPL functions for use in external execution engines.
2121

2222
### Experimental API Design
2323

@@ -33,7 +33,7 @@ Create a context with catalog configuration, query type, and optional settings:
3333

3434
```java
3535
UnifiedQueryContext context = UnifiedQueryContext.builder()
36-
.language(QueryType.PPL)
36+
.language(QueryType.PPL) // or QueryType.SQL for SQL
3737
.catalog("opensearch", opensearchSchema)
3838
.catalog("spark_catalog", sparkSchema)
3939
.defaultNamespace("opensearch")
@@ -44,7 +44,7 @@ UnifiedQueryContext context = UnifiedQueryContext.builder()
4444

4545
### UnifiedQueryPlanner
4646

47-
Use `UnifiedQueryPlanner` to parse and analyze PPL queries into Calcite logical plans. The planner accepts a `UnifiedQueryContext` and can be reused for multiple queries.
47+
Use `UnifiedQueryPlanner` to parse and analyze PPL or SQL queries into Calcite logical plans. The planner accepts a `UnifiedQueryContext` and can be reused for multiple queries.
4848

4949
```java
5050
// Create planner with context
@@ -53,6 +53,9 @@ UnifiedQueryPlanner planner = new UnifiedQueryPlanner(context);
5353
// Plan multiple queries (context is reused)
5454
RelNode plan1 = planner.plan("source = logs | where status = 200");
5555
RelNode plan2 = planner.plan("source = metrics | stats avg(cpu)");
56+
57+
// SQL queries are also supported (with QueryType.SQL context)
58+
RelNode plan3 = planner.plan("SELECT * FROM logs WHERE status = 200");
5659
```
5760

5861
### UnifiedQueryTranspiler
@@ -226,5 +229,4 @@ public class MySchema extends AbstractSchema {
226229

227230
## Future Work
228231

229-
- Expand support to SQL language.
230232
- Extend planner to generate optimized physical plans using Calcite's optimization frameworks.

0 commit comments

Comments
 (0)