Skip to content

Support Nullable(Array) - #115165

Closed
alexey-milovidov wants to merge 111 commits into
masterfrom
continue-pr-104816-nullable-array
Closed

alexey-milovidov wants to merge 111 commits into
masterfrom
continue-pr-104816-nullable-array

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Aug 17, 2026 •

Copy link
Copy Markdown
Member

🕵 Supersedes #104816, which cannot be updated because maintainer edits are disabled on its external fork. This carries forward zhanglistar’s implementation, reconciled with current master, including current Arrow IPC paths and the Native format specification.

Related: #104816
Related: #105192

Changelog category (leave one):

  • Experimental Feature

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Add experimental support for Nullable(Array(...)), enabled with allow_experimental_nullable_array_type.


Workflow [PR]
Sync PR [sync-upstream/pr/115165]

zhanglistar and others added 13 commits July 22, 2026 17:06
Handle empty Array(Nothing) element execution in array arithmetic so intDivOrNull does not reach scalar execution with Nothing operands.

Keep native Arrow IPC nullable-list inference and explicit non-nullable Array hints aligned with the nullable-array setting and null_as_default behavior.

Use the nullable-array-aware wrapper while schema inference recursively reapplies Nullable, and pin the legacy nullable JSON test to the old setting.

Add regression coverage for the Array(Nothing) arithmetic case.

CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104816&sha=a0eb8fb019a1f3f354c45782deda46d7aac7918b&name_0=PR&name_1=Unit%20tests%20%28asan_ubsan%2C%20function_prop_fuzzer%29

CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104816&sha=a0eb8fb019a1f3f354c45782deda46d7aac7918b&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20flaky%20check%29

CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104816&sha=a0eb8fb019a1f3f354c45782deda46d7aac7918b&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29

PR: #104816
Respect allow_experimental_nullable_array_type when wrapping array-valued subcolumns extracted through an outer Nullable column. This keeps Nullable(JSON) array paths compatible when random settings disable the experimental Nullable(Array) type.

CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104816&sha=7944b5d0e40cace70422529447e1699f14b8167a&name_0=PR&name_1=Stateless+tests+%28arm_binary%2C+parallel%29&name_2=Tests

PR: #104816
Old analyzer can keep casts as Const(Nullable(Array(...))). Several nullable-array helper paths only detected ColumnConst through checkAndGetColumnConst<ColumnConst>, so they missed the outer constant wrapper and passed Const(Nullable(Array(...))) into array execution paths that expect ColumnArray.

Use checkAndGetColumn<ColumnConst> before inspecting the data column so mapped array functions, arrayFold, arrayReduce, and array arithmetic unwrap const Nullable(Array) arguments consistently.

Related: #104816

CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104816&sha=930b8941d0bff0f02fd904a96f6a30bd16120b53&name_0=PR&name_1=Stateless%20tests%20%28amd_llvm_coverage%2C%20old%20analyzer%2C%20s3%20storage%2C%20DBReplicated%2C%20WasmEdge%2C%20parallel%2C%201%2F3%29
Move allow_experimental_nullable_array_type to the 26.8 settings history block so upgrade checks from 26.7 see it. Preserve nullable-array missing/default handling in external format readers and extracted subcolumns. Narrow the upgrade log allow-list for the system.metric_log_0 readonly warning and adjust focused stateless coverage.

Related: #104816

CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104816&sha=263d7f95798980e19f9c5ccc5cbe7093c36ae78d&name_0=PR&name_1=Fast%20test%20%28arm_darwin%29

CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104816&sha=263d7f95798980e19f9c5ccc5cbe7093c36ae78d&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29
# Conflicts:
#	src/DataTypes/DataTypeNullable.cpp
#	src/DataTypes/Serializations/ISerialization.cpp
#	src/Interpreters/InterpreterCreateQuery.cpp
#	src/Interpreters/InterpreterCreateQuery.h
#	src/Processors/Formats/Impl/ORCBlockInputFormat.cpp
# Conflicts:
#	docs/en/interfaces/specs/NativeFormat.md
#	docs/en/sql-reference/data-types/array.md
#	docs/en/sql-reference/data-types/nullable.md
#	src/Formats/EscapingRuleUtils.cpp
#	src/Functions/array/arrayFold.cpp
#	src/Interpreters/InterpreterCreateQuery.cpp
#	src/Processors/Formats/Impl/ArrowBlockInputFormat.cpp
#	src/Processors/Formats/Impl/NativeORCBlockInputFormat.cpp
#	src/Processors/Formats/Impl/ParquetV3BlockInputFormat.cpp
#	src/Storages/AlterCommands.cpp
#	src/Storages/MergeTree/MergeTreeReaderCompact.cpp
#	src/Storages/MergeTree/MutateTask.cpp
#	tests/queries/0_stateless/03212_max_bytes_to_read_for_schema_inference_in_cache.reference
#	tests/queries/0_stateless/03526_date_time_input_format_in_schema_inference_cache.reference
#	tests/queries/0_stateless/03627_input_format_try_infer_variants_in_schema_cache.reference
#	tests/queries/0_stateless/04262_skip_first_lines_with_names_schema_cache.reference
@alexey-milovidov
alexey-milovidov marked this pull request as draft August 17, 2026 17:08
@clickhouse-gh

clickhouse-gh Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [838b125]

Summary: ❌

job_name test_name status info comment
Docs check (Mintlify) FAIL
No direct edits to generated or read-only docs FAIL cidb
Fast test FAIL
Build ClickHouse FAIL
Build (arm_tidy) FAIL
Build ClickHouse FAIL cidb
Code Review DROPPED
Fast test (arm_darwin) DROPPED
Build (amd_debug) DROPPED
Build (amd_asan_ubsan) DROPPED
Build (amd_tsan) DROPPED
Build (amd_msan) DROPPED
Build (amd_binary) DROPPED

@clickhouse-gh clickhouse-gh Bot added the pr-experimental Experimental Feature label Aug 17, 2026
@yakov-olkhovskiy yakov-olkhovskiy self-assigned this Aug 18, 2026

@yakov-olkhovskiy yakov-olkhovskiy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this issue is more complex than this PR addresses - will work on it myself

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Acknowledged. This PR addresses only a partial form of the problem, while the required solution is broader. Closing it so the complete implementation can proceed without retaining this incomplete approach.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Closed in favor of the complete implementation described by the reviewer.

@mintlify

mintlify Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
ClickHouse-docs 🟢 Ready View Preview Aug 19, 2026, 1:32 AM

@zhanglistar

Copy link
Copy Markdown
Contributor

@alexey-milovidov Thanks for your time, I am busy on find my job for now.

This branch was successfully deployed

1 active deployment
staging - docs — 838b1259 Deployed Aug 20, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-experimental Experimental Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants