You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No validation that prevents creating a V2 table with timestamp_ns/timestamptz_ns types #2418
Current schema: covered on main. Creating a v2 table, or loading v2 metadata whose current schema contains timestamp_ns, timestamptz_ns, variant or unknown, now fails with:
DataInvalid => Invalid schema for v2:
- Invalid type for x: timestamp_ns is not supported until v3 but format version is v2.
The type floors and this check were added in #2188 (merged 2026-07-16). According to the git tags, #2188 is in v0.11.0-rc.1 and later, and not in v0.10.1. unknown was added later in #2773, which is not in any tag up to v0.11.0-rc.2. #2417, which referenced this issue, was closed without merging with the comment "Covered by #2188".
Remaining gap: non-current schemas. The check runs only on the current schema. TableMetadata::try_normalize calls validate_schema_format_compatibility, which checks current_schema() only. As a result, on a v2 table:
TableMetadataBuilder::add_schema(..) followed by build() returns Ok when a non-current schema contains timestamp_ns, timestamptz_ns, variant or unknown.
Deserializing v2 metadata JSON that contains such a historical schema succeeds.
Java rejects the first case. TableMetadata.Builder.addSchemaInternal calls Schema.checkCompatibility(schema, formatVersion), which throws IllegalStateException. This comes from reading apache/iceberg main, not from running Java. Java's metadata parser does not run this check on the schemas it reads, so the difference is limited to the builder path.
Expected: add_schema rejects a schema that uses types the table's format version does not support, as Java does. Whether loading should also reject historical schemas is for maintainers to decide, since Java's parser accepts them.
Maintainers could close this issue and track the non-current-schema gap separately, or retitle this one to cover it.
Repro (scratch copy of a766783, integration test using only the public API)
Activity
mfellner commentedon Oct 11, 2026
Related to #2411 (v3 tracking).
Re-checked against main at a766783.
Current schema: covered on main. Creating a v2 table, or loading v2 metadata whose current schema contains
timestamp_ns,timestamptz_ns,variantorunknown, now fails with:The type floors and this check were added in #2188 (merged 2026-07-16). According to the git tags, #2188 is in v0.11.0-rc.1 and later, and not in v0.10.1.
unknownwas added later in #2773, which is not in any tag up to v0.11.0-rc.2. #2417, which referenced this issue, was closed without merging with the comment "Covered by #2188".Remaining gap: non-current schemas. The check runs only on the current schema.
TableMetadata::try_normalizecallsvalidate_schema_format_compatibility, which checkscurrent_schema()only. As a result, on a v2 table:TableMetadataBuilder::add_schema(..)followed bybuild()returnsOkwhen a non-current schema containstimestamp_ns,timestamptz_ns,variantorunknown.Java rejects the first case.
TableMetadata.Builder.addSchemaInternalcallsSchema.checkCompatibility(schema, formatVersion), which throwsIllegalStateException. This comes from reading apache/iceberg main, not from running Java. Java's metadata parser does not run this check on the schemas it reads, so the difference is limited to the builder path.Expected:
add_schemarejects a schema that uses types the table's format version does not support, as Java does. Whether loading should also reject historical schemas is for maintainers to decide, since Java's parser accepts them.Maintainers could close this issue and track the non-current-schema gap separately, or retitle this one to cover it.
Repro (scratch copy of a766783, integration test using only the public API)
Output on main (
cargo test --offline -p iceberg --test repro_2418_min -- --nocapture):The same two tests with
timestamptz_ns,variantandunknownin place oftimestamp_nsalso returnok=true.Found during an agent-assisted audit of v3 support (see #2411). The reproduction above was run against main at a766783.