crate
crate copied to clipboard
Add initial very limited support for correlated subqueries
Summary of the changes / Why this improves CrateDB
Adds support for correlated scalar subqueries within the select list. See https://github.com/crate/crate/issues/12663
- Introduces a new
OuterColumn
symbol to wrap columns from an outer relation. - Adds a
isCorrelated
property toSelectSymbol
to distinguish correlated & non-correlated subqueries - Adds a new
CorrelatedJoin
operator. It takes an input relation and a correlated subquery. For each row in the input row it executes the subquery, outputting a joined row. The execution happens via a newCorrelatedJoinProjection
andCorrelatedJoinProjector
.
(I kept some individual commits but they must be squashed when merging)
Checklist
- [x] Added an entry in
CHANGES.txt
for user facing changes - [x] Updated documentation &
sql_features
table for user facing changes - [x] Touched code is covered by tests
- [x] CLA is signed
- [x] This does not contain breaking changes, or if it does:
- It is released within a major release
- It is recorded in
CHANGES.txt
- It was marked as deprecated in an earlier release if possible
- You've thought about the consequences and other components are adapted (E.g. AdminUI)