Repository navigation
Fix bad cast exception when inserting into Iceberg table partitioned by year/month/day on Date column - #100404
Conversation
…by year/month/day on Date column `ChunkPartitioner::partitionChunk` was passing `DataTypeString` as the result type when executing partition transform functions. For functions like `toYearNumSinceEpoch` (used for the Iceberg `year` transform), this caused `DateTimeTransformImpl` to create a `ColumnString` via `result_type->createColumn()` and then `assert_cast` it to `ColumnVector<UInt16>`, triggering a logical error. The fix uses the pre-computed `result_data_types` (the actual return type of each transform function) instead of a hardcoded `DataTypeString`. Closes #86337 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
Workflow [PR], commit [d525a2f] Summary: ✅ AI ReviewSummaryThis PR fixes an Iceberg insert exception by executing partition transform functions with their real return types instead of forcing ClickHouse Rules
Final Verdict
|
…n schemas The partition transform functions like `toYearNumSinceEpoch` return `UInt16`, which was not handled in `getAvroType`, causing "Unsupported type for iceberg UInt16" exception when writing to Iceberg tables with Date columns partitioned by year/month/day. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
The Stress test (arm_msan) failure is fixed by #101239, which should be merged first. After it is merged, please update the branch to include the fix. |
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
LLVM Coverage Report
Changed lines: 50.00% (7/14) · Uncovered code |
|
Hi — this PR may need backporting to Affected code: Why: ChunkPartitioner.cpp was added recently (post-25.8). git log -S 'ChunkPartitioner::partitionChunk' shows the file was introduced for Iceberg INSERT support in late 2025. The bad-cast LOGICAL_ERROR on Date+year/month/day partitioning is user-visible, makes the documented Other supported branches ( If this should be backported, consider adding |
Antalya 26.3 Backport of ClickHouse#100404 - Fix bad cast exception when inserting into Iceberg table partitioned by year/month/day on Date column
…-partition-year Fix bad cast exception when inserting into Iceberg table partitioned by year/month/day on Date column
ChunkPartitioner::partitionChunkwas passingDataTypeStringas the result type when executing partition transform functions. For functions liketoYearNumSinceEpoch(used for the Icebergyeartransform), this causedDateTimeTransformImplto create aColumnStringviaresult_type->createColumn()and thenassert_castit toColumnVector<UInt16>, triggering a logical error.The fix uses the pre-computed
result_data_types(the actual return type of each transform function) instead of a hardcodedDataTypeString.Closes #86337
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix logical error exception when inserting into an Iceberg table with a
Datecolumn partitioned byyear,month, ordaytransforms.Documentation entry for user-facing changes
Version info
26.5.1.213