Skip to content

v1.1.1

Latest

Choose a tag to compare

@orian orian released this 28 Sep 14:12

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.mod declares go 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), and ASTVisitor has a new
method, VisitColumnTransformer. Visitors embedding DefaultASTVisitor or
PrintVisitor inherit it. See the Breaking section below (also in
COMPATIBILITY.md).

Breaking

  • Column transformers have their own node (#126): SelectItem.Modifiers
    is []*ColumnTransformer (was []*FunctionExpr), with Kind ("EXCEPT",
    "REPLACE", "APPLY"), Strict, HasParen and Args. ASTVisitor has a
    new method, VisitColumnTransformer; visitors embedding DefaultASTVisitor
    or PrintVisitor inherit it.

Changed behavior

  • Column transformers print with a space before parentheses, as in
    ClickHouse: * EXCEPT (a) APPLY (sum) (was EXCEPT(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 in EXCEPT, REPLACE (a) without AS, APPLY(f, g),
    and EXCEPT strict (STRICT is always the modifier; write EXCEPT (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 *Path whose 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