Column transformers and qualified stars, following ClickHouse 26.8.
- Column transformers without parentheses and with
STRICT(#126):
* EXCEPT a,* EXCEPT STRICT (a, b),* EXCEPT 'regex',
* REPLACE a + 1 AS a,* APPLY toString,* APPLY x -> x + 1.STRICT
is kept: ClickHouse fails on a missing column instead of ignoring it. SELECT db.t.* FROM db.t, a star qualified by database and table, also
with transformers (#152).go.moddeclaresgo 1.27, and any Go 1.27.x toolchain works.
⚠️ This patch release contains a breaking API change.SelectItem.Modifiers
is now[]*ColumnTransformer(was[]*FunctionExpr), andASTVisitorhas a new
method,VisitColumnTransformer. Visitors embeddingDefaultASTVisitoror
PrintVisitorinherit it. See the Breaking section below (also in
COMPATIBILITY.md).
Breaking
- Column transformers have their own node (#126):
SelectItem.Modifiers
is[]*ColumnTransformer(was[]*FunctionExpr), withKind("EXCEPT",
"REPLACE","APPLY"),Strict,HasParenandArgs.ASTVisitorhas a
new method,VisitColumnTransformer; visitors embeddingDefaultASTVisitor
orPrintVisitorinherit it.
Changed behavior
- Column transformers print with a space before parentheses, as in
ClickHouse:* EXCEPT (a) APPLY (sum)(wasEXCEPT(a) APPLY(sum)) (#126).
Newly rejected input
- An alias on a column matcher:
SELECT * AS x,t.* AS x,
COLUMNS(…) AS x,* EXCEPT (a) AS x(#126). - Column transformer arguments ClickHouse rejects:
EXCEPT (t.a), mixing a
regex with names inEXCEPT,REPLACE (a)withoutAS,APPLY(f, g),
andEXCEPT strict(STRICT is always the modifier; writeEXCEPT (strict))
(#126).
Additive
- Newly accepted input: column transformers without parentheses and with
STRICT:* EXCEPT a,* EXCEPT STRICT (a, b),* EXCEPT 'regex',
* REPLACE a + 1 AS a,* APPLY toString,* APPLY x -> x + 1(#126). - Newly accepted input: a star qualified by database and table,
SELECT db.t.* FROM db.t, with column transformers (db.t.* EXCEPT (a))
(#152). It parses as a*Pathwhose last field is the*identifier;
t.*is still a*NestedIdentifier.
What's Changed
- Parser: accept a star qualified by database and table, db.t.* (#152) by @orian in #155
- Parser: model column transformers; accept STRICT and paren-free forms (#126) by @orian in #156
- Release v1.1.1 by @orian in #157
Full Changelog: v1.1.0...v1.1.1