...
Ignite community is willing to work on a prototype of alternate SQL engines and selected Apache Calcite as the first candidate.
Info |
---|
Intro to Apache Calcite: |
Below you can see a list of the limitations of the current SQL engine outlined technically:
...
There are several example of successful Calcite integrations (Apache Drill, Apache Flink, Hive, etc)
Calcite based SQL engine requirements
...
Generate the same execution plan as H2 for commonly used queries (co-located queries) - only two phases, this means there is no intermediate local task having a Sender on top of execution sub-graph and a Receiver at the bottom for such query (except cases when such behavior is forced by hints - it's helpful to delegate results aggregation to server nodes in case a requesting client have a little free memory).
- Provide an ability to execute any non-recursive non-collocated queries in reasonable period of time.
- Ability to obtain execution plan in human readable form (explain plan).
- Provide memory management abilities to defend the application from OOM (lazy result retrieval, memory quotes, using disk for intermediate results, etc).
- Provide SQL enhancement abilities (system functions, user defined functions, hints, etc).
- Generate optimal execution plan for non-recursive non-collocated queries taking into consideration two factors: a) transferring data amount, b) each local subtask execution complexity.
- Ability to setup query timeout and cancel running query manually.
- Leverage primary and secondary indices.
- Provide enhancement points for future improvements (new transformation rules, different source data structure types support - indexes and tables initially and prefix trees or spatial indexes in future, possible column based storage support in future, etc).
The list may be increased.
Implementation details
...
Apache Calcite uses graph based representation of relational operators, each node has node specific meta information (join type, projection columns, sort operation direction) and general outgoing data properties (traits in terms of Calcite). Each node may have limited count of trait types (equal to count of registered Trait definitions for a planner). Trait types are defined for whole graph before its construction. Calcite framework transforms nodes (node specific properties), data traits and even nodes position based on initial nodes meta information, data traits and relative position.
...
Gliffy Diagram |
---|
| |
---|
name | Optimized physical plan |
---|
pagePin | 1 |
---|
|
Expected integration steps
...
- Ignite logical convention implementing (Relational graph nodes, converter rules), so, Calcite can use Ignite's own operations costs, we have a control on what variant of graph is preferable.
- Index Scan rules implementing - Apache Phoenix experience may be reused. Range filters, sorted scans, some projections transform into index scans.
- Exchange related rules implementing (affinity aware) - Apache Drill experience may be reused. SINGLETON, RANDOM, HASH and BROADCAST distribution types needed.
- Sender/Receiver infrastructure implementing. - Each Exchange rewrites into a pair of Receiver and Sender where Receiver is a relation node and Sender is an infrastructure object which is used to stream target Exchange subgraph result to a particular remote receiver.
- Physical convention implementing - as a start point we may use one of provided by Calcite conventions (Bindable, Enumerable, Interpretable) rewriting particular relational nodes and converter/transform rules into our own implementations one by one.
...
https://drill.apache.org/
Apache Calcite-powered SQL Engine Roadmap
Tickets
Jira |
---|
server | ASF JIRA |
---|
serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
---|
key | IGNITE-12248 |
---|
|
...
Jira |
---|
server | ASF JIRA |
---|
columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
---|
maximumIssues | 20 |
---|
jqlQuery | project = IGNITE AND labels = h2-limitation |
---|
serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
---|
|
Related documents
Volcano/Cascades optimizer
Columbia optimizer