Repository navigation
Native Common Virtuals for File-Like - #101409
Conversation
|
Workflow [PR], commit [6f77c39] Summary: ❌
AI ReviewSummaryThis PR adds a new Findings
Tests
ClickHouse Rules
Final Verdict
|
| {"_data_lake_snapshot_version", makeNullable(std::make_shared<DataTypeUInt64>())}, | ||
| {"_row_number", makeNullable(std::make_shared<DataTypeInt64>())}, | ||
| {"_iceberg_metadata_file_path", std::make_shared<DataTypeLowCardinality>(std::make_shared<DataTypeString>())}, | ||
| {"_table", std::make_shared<DataTypeLowCardinality>(std::make_shared<DataTypeString>())}, |
There was a problem hiding this comment.
_table) for file-like storages, but this PR doesn't add any tests for it.
Please add stateless coverage for at least:
- selecting
_tablefromFile/URL/object-storage-backed reads; - filtering by
_table(to ensure virtual-column filtering path stays correct); - behavior when a real column named
_tableexists (virtual should not shadow user schema).
Without this, regressions in virtual-column wiring are easy to miss.
|
|
||
| #include <Columns/ColumnsNumber.h> | ||
| #include <Interpreters/Context_fwd.h> | ||
| #include <Interpreters/StorageID.h> |
There was a problem hiding this comment.
Adding #include <Interpreters/StorageID.h> to VirtualColumnUtils.h brings a heavy header (AST/QualifiedTableName/fmt dependencies) into every translation unit that includes this widely-used storage utility header.
VirtualsForFileLikeStorage only needs a reference type, so a forward declaration is enough in the header:
struct StorageID;and keep the full include in VirtualColumnUtils.cpp.
This avoids unnecessary transitive recompilation and keeps compile-time impact lower.
LLVM Coverage Report
Changed lines: 96.97% (64/66) · Uncovered code |
After removing the `storage_id` initializer, the `26.3` build hit a second error from the same #105584 backport: src/Storages/HivePartitioningUtils.cpp:70:26: error: no member named 'allow_number_leading_zeros' in 'DB::FormatSettings' `buildHiveFormatSettings` sets `allow_number_leading_zeros`, but that `FormatSettings` field was introduced by a separate prerequisite, "Fix for hive partitioning with leading zeros" (master commit `1d9caa0d168`), which — like #101409 — was never backported to `26.3`. Drop the assignment. `26.3` keeps its existing leading-zeros parsing behavior (consistent with that prerequisite not being backported), while the actual point of #105584 — honoring `cast_string_to_date_time_mode` for hive partition values — is preserved. A full scan of the #105584 backport diff confirms these were the only two symbols absent on `26.3`; all other referenced symbols (`convertFieldToType` with `FormatSettings`, `cast_string_to_date_time_mode`, `buildHiveFormatSettings`) exist on the branch. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=106612&sha=5d9df59d9052889a5665790edc4851f56f2fd9e4&name_0=BackportPR Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The `26.3` build was broken with:
src/Storages/StorageFile.cpp:1658:22: error: field designator
'storage_id' does not refer to any field in type
'VirtualsForFileLikeStorage'
This was introduced by the backport of ClickHouse#105584 ("Honor
`cast_string_to_date_time_mode` for hive partition values"), which
cherry-picked a `.storage_id = storage->getStorageID()` initializer for
`VirtualsForFileLikeStorage`. On `master` that field exists because it
was added by ClickHouse#101409 ("Native Common Virtuals for File-Like"), but
ClickHouse#101409 was never backported to `26.3`, so the struct here has no
`storage_id` member and the designated initializer fails to compile.
`addRequestedFileLikeStorageVirtualsToChunk` on `26.3` never reads
`storage_id`, so removing the initializer is behavior-preserving and
restores the build for the whole release branch.
CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=106498&sha=b7c045c7bd5bb605b946fe1d77092a02ccef89bb&name_0=BackportPR
Surfaced on PR: ClickHouse#106498
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
After removing the `storage_id` initializer, the `26.3` build hit a second error from the same ClickHouse#105584 backport: src/Storages/HivePartitioningUtils.cpp:70:26: error: no member named 'allow_number_leading_zeros' in 'DB::FormatSettings' `buildHiveFormatSettings` sets `allow_number_leading_zeros`, but that `FormatSettings` field was introduced by a separate prerequisite, "Fix for hive partitioning with leading zeros" (master commit `1d9caa0d168`), which — like ClickHouse#101409 — was never backported to `26.3`. Drop the assignment. `26.3` keeps its existing leading-zeros parsing behavior (consistent with that prerequisite not being backported), while the actual point of ClickHouse#105584 — honoring `cast_string_to_date_time_mode` for hive partition values — is preserved. A full scan of the ClickHouse#105584 backport diff confirms these were the only two symbols absent on `26.3`; all other referenced symbols (`convertFieldToType` with `FormatSettings`, `cast_string_to_date_time_mode`, `buildHiveFormatSettings`) exist on the branch. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=106612&sha=5d9df59d9052889a5665790edc4851f56f2fd9e4&name_0=BackportPR Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Part of #100766
Version info
26.4.1.484