Repository navigation
Conversation
|
Workflow [PR], commit [2491794] Summary: ✅
AI ReviewSummaryThis PR fixes several real manifest-write mismatches in the Findings❌ Blockers
Final VerdictStatus:
LLVM Coverage ReportMeasured on commit 2491794.
Changed lines: Changed C/C++ lines covered: 89/127 (70.08%) · Uncovered code |
The manifest partition schema and record used ClickHouse source column names, which can differ from the spec's own field names. Read the names from the persisted spec and drop the `partition_columns` parameter. Addresses #109286 (comment) Co-Authored-By: Claude Fable 5 <[email protected]>
icebergBucket returns UInt32, so its result reaches writePartitionRecord as Field::UInt64 while the manifest partition field is Avro int. #109286 (comment) Co-Authored-By: Claude Fable 5 <[email protected]>
icebergBucket returns UInt32, so its result reaches writePartitionRecord as Field::UInt64 while the manifest partition field is Avro int. #109286 (comment) Co-Authored-By: Claude Fable 5 <[email protected]>
b60a515 to
5730614
Compare
|
Updating the branch to fix the |
The manifest `data_file.partition` Avro record and its schema were named
from the source column names (`ChunkPartitioner::getColumns`), but Iceberg
requires them to be the partition spec's field names. These differ from the
source column names for transforms (e.g. `id` -> `id_bucket`) and after a
`RENAME COLUMN`, so a manifest written for such a table did not match the
table's own partition spec, even though this PR already writes the correct
field-ids.
Take the partition field names from the persisted spec
(`partition_spec->getArray("fields")[i]->getValue<String>("name")`) in both
`extendSchemaForPartitions` and `writePartitionRecord`, mirroring what
`Compaction.cpp` already did. `generateManifestFile` no longer needs the
source column names, so its `partition_columns` parameter is dropped.
This is a no-op for ClickHouse-created tables (there the spec field name
equals the source column name), and does not affect ClickHouse's own reads,
which parse the `partition` record positionally and ignore the field names.
Addresses the review finding on
#109286.
|
Automated maintenance update:
|
`writePartitionRecord` chose the Avro datum from the `Field` tag, but ClickHouse stores `UInt8/16/32` (and `Date`) as `Field::UInt64`, so a partial DROP PARTITION rewrite emitted an Avro `long` for a partition field declared `int`, corrupting the survivor manifest. Derive the datum from the partition column type (mirroring `getAvroType`), narrowing to `int` with a range check that throws on overflow. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
writePartitionRecord read the partition value with safeGet<Int64> on a Decimal64 Field (e.g. a DateTime64 partition value), throwing "Bad get: has Decimal64, requested Int64". Unwrap the decimal instead. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The manifest partition struct hardcoded field-ids 1000+i, but the partition spec numbers them differently per writer (1001+i for ClickHouse-created tables, 1000+i for Spark-created). Iceberg projects partition values by field-id, so the mismatch made a reader cast a long onto an int field (Spark ClassCastException). Derive the ids from the persisted spec. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
A `UInt64` partition value above `Int64::max` was cast to `Int64` and written as a negative Avro `long`, silently corrupting the survivor manifest during a partial `DROP PARTITION` rewrite. Throw `BAD_ARGUMENTS` for values that cannot be represented by Iceberg's signed `long` instead of wrapping. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
`writePartitionRecord` had `Decimal32`/`Decimal64` branches, but `getAvroType` has no `Decimal*` case, so the manifest schema extension rejected decimal partition columns up front anyway. Remove the dead branches so decimal partitions fail consistently and early rather than appearing partially supported. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Covers UInt32 (Avro int) and DateTime64 (Decimal64 ticks to Avro long) identity partitioning, and rejection of UInt64 partition values that do not fit into Iceberg's signed long. Co-Authored-By: Claude Fable 5 <[email protected]>
The caller passes DataTypes, whose allocator differs from std::vector<DataTypePtr>. Co-Authored-By: Claude Fable 5 <[email protected]>
Equality predicates on a DateTime64 identity partition prune wrongly on master (the manifest value is parsed as Int64 while the pruning path requests Decimal64), and an INSERT of a UInt64 value above the signed long range wraps in the data-path cast before partitioning, so neither belongs to this change. Co-Authored-By: Claude Fable 5 <[email protected]>
icebergBucket returns UInt32, so its result reaches writePartitionRecord as Field::UInt64 while the manifest partition field is Avro int. #109286 (comment) Co-Authored-By: Claude Fable 5 <[email protected]>
9c073e2 to
466add4
Compare
|
#109286 (comment) - the commit about not using columns was fine but breaks sync, i've tried to do it too but gave up for now for this PR. |
|
Automated maintenance update:
|
Build profile diff (arm_release)Commit See the job log for details. |
Use persisted partition-spec field names for both manifest schemas and records. #109286
`getAvroType` threw for every `DateTime64` scale other than 6, but `IcebergSchemaProcessor` maps Iceberg `timestamp_ns` back to `DateTime64(9)`. Metadata-derived rewrite paths (compaction, mutations) reconstruct partition types through that mapping, so a `timestamp_ns` partition field reached this helper and was rejected. Accept scale 9 and emit the matching `timestamp-nanos` Avro logical type. Addresses the review finding about incomplete `DateTime64` scale handling in the manifest schema path.
|
🕵 Automated maintenance update:
|
|
📊 Cloud Performance Report ✅ AI verdict: Release-transition baseline: compared against the most recent available 26.9 masters at or before the trusted base-commit anchor because no 26.10 master baseline exists there. no significant changes detected. K_source=6 K_base=30 flagged=0/65 clickbench🟢 No significant changes tpch_adapted_1_official🟢 No significant changes Debug info
|
…n-value-encoding Conflicts in `IcebergWrites.cpp`: keep the PR's `writePartitionRecord`/`convertToAvro` (spec field names, type-derived Avro datums) and adopt master's Decimal partition support (`getAvroType(type, field_id)` and the Avro `fixed` datum via `makeDecimalFixedDatum`).
The vendored Avro C++ library has no `timestamp-nanos` logical type, so `AvroSchemaReader::avroNodeToDataType` reads such a manifest partition value back as a raw `Int64`. Manifest compaction then carries that value into the partition summaries, where `dumpFieldToBytes` expects a `Decimal64` for a `DateTime64` field. Writing `timestamp-nanos` therefore only moved the failure of a `timestamp_ns`-partitioned table from the manifest writer to the summary rewrite. Keep rejecting scales other than 6 until a readback path exists. Addresses the review finding on the `timestamp_ns` rewrite-path claim.
… test The ClickHouse manifest reader parses `data_file.partition` positionally, so the round-trip alone could not detect a manifest whose partition record used source column names or the `1000 + i` default field ids. Inspect the written manifest directly: the Avro schema must carry the spec `field-id` (1001 for the first spec field) and the record field must be the spec field name. Addresses the review request for a focused regression on the field-name/id fix.
|
🕵 Automated maintenance update (2026-09-04):
|
Iceberg `time` is a 64-bit value in the specification, so the manifest `data_file.partition` field for a `time` partition must be an Avro `long`. `getAvroType` mapped `Time` to `int`, and `convertToAvro` followed it. That mapping is also inconsistent with the manifest rewrite paths (compaction, mutations): they rebuild the partition types from the persisted metadata, where `IcebergSchemaProcessor` maps Iceberg `time` to `Int64` and therefore emits an Avro `long`. The same happens for a directly declared `Time` partition column, because the table schema is re-derived from the persisted Iceberg schema, so the `int` branch was in practice unreachable - a latent trap rather than an observable break. Both paths now agree with each other and with the spec. No `time-micros` logical type is attached: ClickHouse `Time` values are whole seconds, and rescaling them to microseconds here would desynchronize the manifest partition value from the value stored in the data file. The unit question is a separate representation decision. The test covers an `INSERT` and an `OPTIMIZE` manifest rewrite of a `time`-partitioned table, and checks the written manifest Avro type. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
🕵 Status update (pass of 2026-09-10, head
Blockers: fresh CI on the merged head, an AI re-verdict, and human review/merge. |
|
🕵 Status update (pass of 2026-09-18, head
|
|
🕵 Status update (pass of 2026-09-24, head
@groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=109286&sha=b4aa6fba9c0cfbf814fd4b2f41974b5df270d015&name_0=PR&name_1=Stateless%20tests%20%28amd_llvm_coverage%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29 and provide a fix in a separate PR. If the fix is already in progress, link it here. |
|
Investigated. Those three reds are not from this PR. They are the That file is an expected-to-fail list, not a skip list: a listed test that passes is itself reported as a failure ( Fix-presence checks:
So the fixing PR is #120763, already merged and already an ancestor of the current head, and there is no new PR from me here. The coverage lane has not re-run on |
Related: #105198
Fixes Iceberg manifest partition value encoding from the declared partition type and writes persisted partition-spec field names and ids into manifest partition records. Iceberg
timestamp_ns(DateTime64(9)) partition fields stay rejected on purpose: the vendored Avro library cannot readtimestamp-nanosback, so the manifest rewrite path could not consume them. Icebergtimepartition fields are now written as an Avrolong, matching the specification and the manifest rewrite paths, which rebuild the partition type from the persisted metadata asInt64.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixes
INSERTinto Iceberg tables partitioned byUInt8/UInt16/UInt32columns,DateTime64,Float32, oricebergBucket, writes manifest partition field names and ids from the table partition spec so external Iceberg readers interpret partition values correctly, and writes Icebergtimepartition fields as a 64-bit value as the specification requires.Workflow [PR]
Sync PR [sync-upstream/pr/109286]