Support iceberg schema type change#223
Conversation
| static void AssertInternalAndExternalIcebergDataFileColumnStatsMatch(List *internalColumnStatsList, | ||
| List *externalLowerBounds, | ||
| List *externalUpperBounds); | ||
| static void NormalizeColumnBound(Field * field, unsigned char *externalValue, |
There was a problem hiding this comment.
note: we do not need these for the existing catalog values as we store them text. We can interpret them correctly when we cast their text value to new widen type.
That is only needed when we deserialize values of old type from parquet datafile or iceberg metadata.
1c4ecae to
525f874
Compare
a4c0a79 to
d6610a0
Compare
|
trying to change the type to numeric(39,8) proceeds, but causes downstream failures: |
d6610a0 to
da940ba
Compare
we should disallow when we widen above 38, which are not supported by iceberg (we fallback to text). |
Signed-off-by: Aykut Bozkurt <aykut.bozkurt@snowflake.com>
da940ba to
0fd9325
Compare
|
Rebased onto main (conflict was just the import block in The pattern is partition values that are NULL. Test failures:
I think the trigger is in The numeric case may have a second issue too. DCO still fails on this branch because the two commits don't have Happy to take a look at the patch once you have a fix. |
The heavy-assert stats check now routes external partition values and column bounds through PGIcebergBinaryDeserialize to widen them for type promotions. That function asserts its input is non-NULL, so a NULL partition value, such as a NULL row or a NaN numeric that Iceberg stores as NULL, aborted assert-enabled backends during commit. This is why test_string_edge_values, test_insert_select_null_partition_value, and test_vacuum_clamped_values[numeric-identity] crashed the server in CI. A NULL or empty value has no bytes to widen, so pass it through unchanged. This matches the pre-promotion behaviour, where these values compared equal with a zero-length memcmp. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Marco Slot <marco.slot@snowflake.com>
We should support schema type evolution according to iceberg spec v2, our current iceberg implementation. This should not require data file rewrite, but metadata-only operation.
Closes #222.