Repository navigation
Conversation
|
Workflow [PR], commit [55a59fa] Summary: ❌
|
Build profile diff (arm_release)Comparing Binary sizes
The official master build is compiled with Object file sizes
|
| Object file | Master | PR | Δ |
|---|---|---|---|
src/Parsers/CMakeFiles/clickhouse_parsers.dir/ASTNameWithParameters.cpp.o |
new | 307.15 KiB | +307.15 KiB |
src/Parsers/CMakeFiles/clickhouse_parsers.dir/ASTCodec.cpp.o |
new | 84.79 KiB | +84.79 KiB |
719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.
Compile time of recompiled translation units
1125 translation units recompiled, 7080 s compile time in total, 1061 of them have a recent master baseline.
Translation units without a recent master baseline:
programs/keeper/Keeper.cpp (clickhouse-keeper): 7.2 s
…heck `* APPLY f` lists `f(c)` expressions, so a later `expr AS `f(c)`` is a second column, not a redefinition of a starred one (ClickHouse#14739). It now gets a unique internal name like the explicit `f(c), expr AS `f(c)`` pair, and an outer `SELECT *` keeps both values. Found by the AST fuzzer oracle on ClickHouse#126056. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ment children Otherwise every generic tree walk had to special-case ASTTTLElement
`CODEC(LZ4)` became a child of `ASTTTLElement`, so the recursive screen behind
`readExpressionChild` started walking into it and rejecting `LZ4`:
ALTER TABLE t MODIFY TTL d + toIntervalDay(1) RECOMPRESS CODEC(LZ4)
Code: 36. Function 'LZ4' for key 'ttl' has no 'arguments' list during AST JSON deserialization
The slot is already validated by `readSpecialFunctionChild` in
`ASTTTLElement::readJSON`, so skip just that child and keep screening the rest
(the `GROUP BY` keys are now screened too, which they were not before).
Fixes 05230_ast_json_storage_expression_argumentless_function.
Putting the TTL `RECOMPRESS` codec into `ASTTTLElement::children` exposed it to `UserDefinedSQLFunctionVisitor`, so `CREATE FUNCTION ZSTD AS x -> x + 1` rewrote `RECOMPRESS CODEC(ZSTD(1))` into `UNKNOWN_CODEC: Unknown codec family: plus`, and a parameterless `CODEC(LZ4)` into an out-of-range error - it has no `arguments` child. Column `CODEC`/`STATISTICS` were already affected. Codec and statistics elements are names, not expressions: skip those subtrees. Refs: ClickHouse#126056 (comment)
…rs instead of ASTFunction `CODEC(LZ4, ZSTD(3))` was an `ASTFunction` of `Kind::CODEC` whose elements were `ASTFunction`s without an `arguments` list - the only such shape the parser produces - so every generic function pass had to be taught about it (UDF expansion, the AST JSON screen, `no_empty_args` formatting), the kind was settable from `clickhouse_json`, and consumers dereferenced a null list. `ASTCodec` holds a never-empty `ASTExpressionList` of `ASTNameWithParameters` (name plus optional parameter list); `STATISTICS(...)` and the `TYPE` list of `ALTER ... STATISTICS` are the same element list without a wrapper. This drops `Kind::CODEC`/`Kind::STATISTICS`, `readSpecialFunctionChild` and the `ASTTTLElement` carve-out in the argumentless-function screen. `TYPE minmax` of a skip index or an index projection was an `ASTFunction` without `arguments`, so a UDF named `minmax` rewrote it like a call. `ASTIndexDeclaration::getType` and `ASTProjectionDeclaration::type` are now `ASTNameWithParameters`; `ParserExpressionWithOptionalArguments` is retired. Co-Authored-By: Claude <[email protected]>
b656052 to
163f448
Compare
… parse inside CODEC
…st tests to the new grammar `Kind::CODEC`/`Kind::STATISTICS` used to force `allow_operators = false`; keep that so the stored codec text is unchanged (04241). Window functions, NULLS modifiers and `trim(BOTH ...)` no longer parse inside `CODEC`/`STATISTICS`/`TYPE` (04356, 05175), and an implicit minmax index now reports `type_full` as `minmax` like a declared one (03748, 03792).
| } | ||
|
|
||
| node = function_node; | ||
| node = make_intrusive<ASTNameWithParameters>(getIdentifierName(name), parameters ? std::move(parameters->children) : ASTs{}); |
There was a problem hiding this comment.
[P1] Preserve loading of previously accepted table metadata
The stricter grammar also runs when loading existing tables, and the removed forms were not all rejected by the old interpreters. For example, the previous fast-test binary successfully creates and populates:
CREATE TABLE t (x UInt64 STATISTICS(tdigest() IGNORE NULLS))
ENGINE = MergeTree ORDER BY x;
INSERT INTO t VALUES (1), (2);SHOW CREATE TABLE retains STATISTICS(tdigest() IGNORE NULLS). I verified that the old binary reloads the persisted table and returns both rows, while this head's binary opening the same data directory exits with code 62: Cannot parse definition from metadata file, at IGNORE. STATISTICS(tdigest(1)(2)) is also accepted and persisted before this change; so is CODEC(Delta() IGNORE NULLS, ZSTD) on Tuple(UInt32, UInt64), where codec preprocessing preserves the original descriptor.
Even if these modifiers have no useful semantics, rejecting their stored definitions makes existing data inaccessible after upgrade, contrary to the backward compatibility promised here. Please preserve parsing/normalization of legacy descriptors during metadata loading and add a focused ATTACH regression for an old accepted definition. Restrictions on new definitions can be enforced separately.
…on calls Until 26.11 these slots held an `ASTFunction`, so stored metadata can spell a name as `name(x)(y)` - the second list is the one the factories read - or carry `IGNORE NULLS` / `RESPECT NULLS` / `OVER ...`, which nothing read. `ParserNameWithParameters` accepts those tails and drops them, marking the node `legacy_syntax`; formatting writes the canonical name. A new definition is still rejected: `rejectLegacyNameSyntax` runs in the create (non-attach), alter and create-index interpreters, which no stored-metadata path goes through.
99d38dc to
a865c2f
Compare
55a59fa to
90594a8
Compare
This change should be mostly cosmetic, it changes some corner cases, but it should be backward compatible
Changes
ASTTTLElementdoes not useschildren, hence requires special tree walk - store all nodes inchildrenZSTD(CODECchildren) with UDFs, so now there are separate nodes forASTCodecandASTNameWithParametersboost::container::out_of_rangeforCREATE FUNCTION minmax- https://fiddle.clickhouse.com/85cdcf00-b531-48bd-afef-48eabde8404eCODEC(...)/STATISTICS(...)/TYPEno longer accept function-only syntax (windowOVER,IGNORE NULLS,trim(BOTH …), parametricf(1)(2)), which were never valid codecs/types anyway and are now syntax errors instead of laterUNKNOWN_CODEC/INCORRECT_QUERYsystem.data_skipping_indices.type_fullno longer appends empty parenthesis for implicitly created indexes (previously it lacksno_empty_args) so now it matches with the explicitly created indexesChangelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
A SQL UDF whose name coincides with a compression codec or a skip-index type (e.g.
ZSTD,minmax) no longer breaksCREATE TABLE/ALTER TABLEstatements that use that codec or index.system.data_skipping_indices.type_fullshows an implicitminmaxwithout extra parenthesis (minmax())Workflow [PR]
Sync PR [sync-upstream/pr/126056]