Repository navigation
GA Nullable(Tuple(...)) - #119222
GA Nullable(Tuple(...))#119222
Nullable(Tuple(...))#119222Conversation
…olumns by default
|
Workflow [PR], commit [32a2ea7] Summary: ✅
AI ReviewSummaryThis PR makes Findings
Final VerdictStatus:
LLVM Coverage ReportMeasured on commit 32a2ea7.
Changed lines: Changed C/C++ lines covered: 214/225 (95.11%) · Uncovered code |
Resolved conflicts: - `src/Core/SettingsChangesHistory.cpp`: kept both the GA default flips for `allow_experimental_nullable_tuple_type`, `enable_nullable_tuple_type` and `allow_nullable_tuple_in_extracted_subcolumns` and master's new 26.9 entries. - `src/DataTypes/DataTypeNullable.cpp`, `src/DataTypes/DataTypeTuple.cpp`: master rewrote the beta notes from `:::note` to `<Note>`; this branch removes those notes entirely, so the removal wins. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…r versions The Kafka Connect page said the multi-message union schema is supported from `26.9`, while the section heading and the inline comments in the snippet still described it as unsupported. Scope both to the versions where the restriction actually applies. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`allow_nullable_tuple_in_extracted_subcolumns` is read from the global context, which a gtest does not have by default, so the two tests updated for the GA defaults read the setting as off and failed. Establish the shared test context so the shipped default applies, which is what these tests are meant to pin. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`05216_orc_nested_null_as_default_pushdown` issues about 1900 queries and `05214_orc_nullable_set_filter_pushdown` started 112 client processes, one per query. In the normal phase they take 80-90 s on sanitizer builds, and the flaky check, which reruns a new test five times on a debug or sanitizer server, killed `05216` at the 600 s hard timeout and reported `05215` as running too long (> 180 s) in every flaky-check job. The cases of `05215` and `05216` are independent, so each `run_case` now runs in the background writing to its own file under `CLICKHOUSE_TMP`, and the outputs are printed in the original order after `wait`. `05214` batches all predicates of a column into one client run and prints the label from the query itself (`TSVRaw` keeps the quotes in `tupleElement(t, 'x')` unescaped). References are unchanged. Local timing with a release build: `05216` 8.8 s -> 1.4 s, `05214` 7.7 s -> 1.1 s, `05215` 2.3 s -> 0.8 s. CI: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=119222&sha=78bbd4423ee14a6d65dd88932933007a9e9e9ca6&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20flaky%20check%29 PR: ClickHouse#119222 Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
🕵 Status after b16d2cf (merged
|
| Always ignore ON CLUSTER clause for DDL queries with replicated databases. | ||
| )", 0) \ | ||
| DECLARE_WITH_ALIAS(Bool, enable_nullable_tuple_type, false, R"( | ||
| DECLARE_WITH_ALIAS(Bool, enable_nullable_tuple_type, true, R"( |
There was a problem hiding this comment.
The source-of-truth docs change here, but the generated English reference pages are still on the pre-GA contract. In the current tree, docs/reference/settings/session-settings/allow-experimental.mdx still shows allow_experimental_nullable_tuple_type as Beta with default 0, docs/reference/settings/beta-and-experimental-features.mdx still lists it, docs/reference/settings/session-settings/allow.mdx still shows allow_nullable_tuple_in_extracted_subcolumns default 0, docs/reference/data-types/tuple.mdx and docs/reference/data-types/nullable.mdx still require SET enable_nullable_tuple_type = 1, and the generated BigQuery engine/table-function pages still say persistent tables require that setting. Since /docs/reference is the published English docs, the PR currently ships GA/default-on behavior while documenting the opposite. Please regenerate/update the affected reference pages from the updated source registrations before merge.
There was a problem hiding this comment.
The regeneration happens through the dedicated docs autogeneration workflow, not in feature PRs.
There was a problem hiding this comment.
🕵 Confirming the author's answer with the tree at 32a2ea7: every location this finding cites lies between the {/*AUTOGENERATED_START*/} and {/*AUTOGENERATED_END*/} markers of its page (allow-experimental.mdx 9-373, beta-and-experimental-features.mdx 54-223, allow.mdx 9-395, data-types/tuple.mdx 9-216, data-types/nullable.mdx 9-78, both bigquery.mdx pages 9-152 / 9-58). Those regions are regenerated by the dedicated docs autogeneration workflow; feature PRs must not edit them (the docs check fails without the pr-autogenerated-docs label). The sources of truth are all updated in this PR: the DECLARE doc strings in src/Core/Settings.cpp (default true, tier 0), the Nullable/Tuple type docs in src/DataTypes/DataTypeNullable.cpp / DataTypeTuple.cpp (Beta notes and SET enable_nullable_tuple_type = 1 removed), and the BigQuery engine and table function docs in src/Storages/BigQuery/StorageBigQuery.cpp / src/TableFunctions/TableFunctionBigQuery.cpp (the "requires the setting" sentences removed). Nothing else to change here.
…void OOM kills on sanitizer builds
…ith a shared lib
|
🕵 Status on 32a2ea7 (the author's head; nothing to push from my side, the branch is 230 commits behind
|
38170d8
…criminators
For a Variant/Dynamic/JSON element that is a tuple, the null map of a Nullable
field of that element returned 0 on every row holding a different alternative,
although the field itself reads NULL there. Since optimize_functions_to_subcolumns
is enabled by default and rewrites isNull(x) to x.null, a plain
SELECT count() FROM t WHERE value.`Tuple(a Nullable(UInt32), b String)`.a IS NULL
silently dropped the matching rows: 1 instead of 2 on a three-row merged part.
SerializationVariantElement fills rows whose discriminator is not the element's
with the result column's default. For the value read that default IS NULL, so it
is correct; a null map is a bare UInt8 whose default 0 means "not null", which
makes it the one subcolumn whose value for an absent element is not its default.
Nothing on the path could distinguish the two: SerializationVariant::enumerate
Streams attaches one subcolumn creator per alternative, while the selection
happens per subcolumn beneath it, and ISerialization::createFromPath hands a
creator only the selected subcolumn's (serialization, type, column) - where a
null map's type is plain UInt8, indistinguishable from a genuine UInt8 element.
prev_type, which ClickHouse#112338 used to derive nullable_added_by_extraction, therefore
carries one bit too few for this case.
So ISubcolumnCreator gains one virtual with a default no-op,
specializeForSelectedSubcolumn, which names the selected substream to the
enclosing creators. VariantSubcolumnCreator uses it to learn that the selection
is a null map and then writes 1 for absent rows at all four read sites and in
both in-memory creator paths. SerializationVariantElementNullMap already does
exactly this for the top-level x.<Elem>.null, and cannot serve the nested case
because all three of its create() overloads discard prev and would throw away
the field's own on-disk null map. Nine of the ten creators inherit the no-op.
createFromPath and makeSubcolumnInfo also pass the true selected terminal, since
on the dynamically-resolved-descendant arm the leaf lives in the nested path and
path[prefix_len - 1] is only the prefix the dynamic type matched.
Two guards keep the change to the case where the null map is the only place the
information can live: the extraction must not have wrapped the element in
Nullable, where absence is already NULL, and the selection must still be a bare
UInt8, since an Array or Map below has already made it Array(UInt8), whose value
for an absent element is the correct default []. That leaves the fix orthogonal
to ClickHouse#119222, which flips allow_nullable_tuple_in_extracted_subcolumns to true.
No on-disk or format change: the same streams are requested and only the value
written into rows where the element is absent changes. This is not a regression -
released 26.8.3.105 already returns 0 there; our ClickHouse#112338 removed a SIGSEGV on the
sibling value read, which is what makes the contradiction observable and puts the
IS NULL rewrite on a completing path.
Closes: ClickHouse#119935
Co-Authored-By: Claude Opus 5 <[email protected]>
ClickHouse#119222 made schema inference wrap a `Tuple` read from an Arrow struct in `Nullable`, and dropped the multi-line spelling for it, so the `nested` row of `DESC file(..., Arrow)` now reads `Nullable(Tuple(v Variant(Bool, Int8)))`. Measured, not assumed: the master snapshot binary (which does not carry this branch) prints the new line for the same fixture, and the full DESC output of that binary and of this branch is byte-identical, so nothing here touches schema inference. The `struct_utf8` row is unaffected because ClickHouse#119222 keeps a `Tuple` alternative of a `Variant` non-`Nullable`.
Since ClickHouse#119222 `enable_nullable_tuple_type` defaults to 1, so schema inference takes the relaxed Nullable(Tuple) path of this branch for every OPTIONAL struct in the parquet corpus. 00900_long_parquet_load_2: struct-level NULLs in nullable.impala.parquet (nested_struct for id 6, C for id 5, map values g3 and H) were read as tuples of element defaults and are now NULL, which is what pyarrow reads from the same file. The other two moved lines are the WITH TOTALS rows, whose default for a Nullable(Tuple) column is NULL. The master debug binary reproduces the old reference byte for byte, so nothing else in the corpus moves. 04065_parquet_optional_list_map_wrapper_nullable_tuple: the "inference off" case relied on the old default; it now disables the setting itself. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Related: #89643
Related: #107754
Related: #52562
Nullable(Tuple(...))has been available since 26.1 and Beta since 26.6. This makes it generally available:allow_experimental_nullable_tuple_type(aliasenable_nullable_tuple_type) andallow_nullable_tuple_in_extracted_subcolumnsare enabled by default and move to the production tier.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Nullable(Tuple(...))is now generally available and enabled by default.Nullable(Tuple(...))columns can be created without any setting, schema inference of nullable structs in theParquet,Arrow,ORC,AvroandJSONformats returnsNullable(Tuple(...)), and aTuplesubcolumn extracted from aVariant,Dynamic,JSONorNullable(Tuple)column isNullable(Tuple(...))andNULLwhere the value is missing, instead of a tuple of default values. The previous behavior is available withenable_nullable_tuple_type = 0andallow_nullable_tuple_in_extracted_subcolumns = 0; the subcolumn setting is read at server startup, so it has to be set in the default profile. Upgrading existing tables whose partition keys, sorting keys, TTL expressions, or skip indexes depend on a tuple subcolumn extracted from aDynamic,VariantorNullable(Tuple)column or from aJSONpath not declared asTuple(...)is unsafe with the new default: tables may fail to attach, queries may fail, or data parts may be detached during startup. Before the first startup after upgrading, setallow_nullable_tuple_in_extracted_subcolumns = 0in the default profile, or preserve the previous behavior throughcompatibilityin that profile. Changing the setting after parts have been detached does not restore them automatically; those parts must also be reattached.Workflow [PR]
Sync PR [sync-upstream/pr/119222]