Repository navigation
Respect input_format_null_as_default for nulls in non-nullable Arrow fields - #127453
alexey-milovidov merged 6 commits into
Conversation
…t_format_null_as_default`
|
Workflow [PR], commit [984cadf] Summary: ✅
AI ReviewSummaryRestores reading nulls from non-nullable Missing context / blind spots
Final VerdictStatus: ✅ Approve |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes5 object files changed (+25.17 KiB total), 0 added.
719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units8 translation units recompiled, 20 s compile time in total, 8 of them have a recent master baseline. |
…y values; the Apache Arrow library reader did not support these types
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=127453&sha=73687071c5ddc073e7147719414713c589359894&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29 and provide a fix in a separate PR. If the fix is already in progress, link it here. It is unrelated to this PR (repeated |
|
Same signature as #120975: all 177 lines in The fix in progress is #125293 by @ tiandiwonder: test-only, Merging it to master alone will not clear this check, because the Upgrade check runs the previous release's copy of |
Cherry pick #127453 to 26.8: Respect input_format_null_as_default for nulls in non-nullable Arrow fields
…lls in non-nullable Arrow fields
Cherry pick #127453 to 26.9: Respect input_format_null_as_default for nulls in non-nullable Arrow fields
…lls in non-nullable Arrow fields
Cherry pick #127453 to 26.10: Respect input_format_null_as_default for nulls in non-nullable Arrow fields
…ulls in non-nullable Arrow fields
Backport #127453 to 26.10: Respect input_format_null_as_default for nulls in non-nullable Arrow fields
Backport #127453 to 26.8: Respect input_format_null_as_default for nulls in non-nullable Arrow fields
Backport #127453 to 26.9: Respect input_format_null_as_default for nulls in non-nullable Arrow fields
…lls in non-nullable Arrow fields
…lls in non-nullable Arrow fields
Related: #106522
Related: #111996
The native
Arrow/ArrowStreamreader, the default since 26.7 and the only one since 26.8, rejects a field that the schema declares non-nullable but whose batch contains nulls (Arrow IPC field '...' is declared non-nullable but its FieldNode reports N nulls). Producers such as pyarrow write such data without complaint, and the Apache Arrow library reader read those nulls as NULLs, soinput_format_null_as_defaultturned them into defaults. After upgrading to 26.8, users relying on this saw all their inserts fail, with no setting to restore the old behavior.Such fields are now read as NULL, as the library reader did: top-level columns, dictionary-encoded columns, and children of lists, structs and maps. The column is decoded from a copy of its field that declares those fields nullable, so the types derived from the schema stay consistent with the decoded columns. The conversion to the requested type then applies the usual rules: with
input_format_null_as_default = 1the nulls become the columnDEFAULTexpression or the type default for a non-nullable target; with 0 they raiseCANNOT_INSERT_NULL_IN_ORDINARY_COLUMN; aNullabletarget gets NULL either way.Nulls in non-nullable children of union alternatives and of dictionary values are still rejected with
INCORRECT_DATA. Reading them as NULL would make the decoded type depend on each batch's nulls, whichVariantconversion and delta dictionary merging can't handle. The library reader did not support these types either.The rejection was added in #106522 because null rows of a non-nullable field were decoded from undefined value bytes. That no longer happens: a non-zero null count requires a correctly sized validity bitmap regardless of the declared nullability, and null rows are masked before values are decoded.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The
ArrowandArrowStreaminput formats again read nulls in fields declared non-nullable as NULLs instead of rejecting the data, so they are converted to default values wheninput_format_null_as_defaultis enabled (the default). This restores the behavior of the Apache Arrow library reader that was removed in 26.8.Workflow [PR]
Sync PR [sync-upstream/pr/127453]
Version info
26.11.1.676-master(included in26.11and later)26.10.3.5,26.9.26.17,26.8.35.15