Query Translation
Methodology
Summary of the workflow
- Validate SQL query
- Parse the SQL query into SQL clauses
- Translate parsed query
Translation Process
- Process common table expressions
- Create streams: find all of the topics the query depends on (recursively) and create KsqlDB stream for it
a. topic
b. subquery - Translate joins: Add a window clause to each join
- Translate functions:
a. group_concat maps to collect_set or collect_list
b. cast(_ as Date) maps to stringtodate or datetostring` - Identifiers and aliases
ex: transactions.storer replace with burroughs_transactions.storer - Group by
a. Replace integers with the field name
b. Add SMT that extracts the group by from the record key
2021, Burroughs Revision
3341a46