feat: support Iceberg v3 unknown type#662
Open
manuzhang wants to merge 3 commits into
Open
Conversation
wgtmac
reviewed
May 22, 2026
wgtmac
reviewed
May 22, 2026
wgtmac
reviewed
May 22, 2026
Member
|
Please rebase on the latest main as well. |
Add an Iceberg unknown primitive type and JSON, Arrow, Avro, Parquet, projection, and data path support for null-only unknown fields. Enforce optionality invariants so required projections cannot be materialized from unknown/null-only fields. Co-authored-by: Codex <codex@openai.com>
Enforce unknown as a v3-only optional type in schema validation and update paths, allow schema-update promotion from unknown to primitive types, reject unknown-to-nested projection, and reject unsupported Parquet writes for unknown list or map leaves. Co-authored-by: Codex <codex@openai.com>
26ccf9b to
8087ed1
Compare
Assert that promotion helpers reject nested type targets for unknown and regular primitive source types. Co-authored-by: Codex <codex@openai.com>
eb195ac to
d2a34b5
Compare
Member
|
Could you please rebase to resolve conflicts? PR for v3 nano precision timestamp types has been merged. |
zhjwpku
reviewed
May 24, 2026
|
|
||
| TEST(SchemaJsonTest, NestedUnknownFieldsRoundTrip) { | ||
| constexpr std::string_view json = | ||
| R"({"fields":[{"id":1,"name":"profile","required":false,"type":{"fields":[{"id":2,"name":"mystery","required":false,"type":"unknown"}],"type":"struct"}},{"id":3,"name":"mysteries","required":false,"type":{"element":"unknown","element-id":4,"element-required":false,"type":"list"}},{"id":5,"name":"properties","required":false,"type":{"key":"string","key-id":6,"type":"map","value":"unknown","value-id":7,"value-required":false}}],"schema-id":1,"type":"struct"})"; |
Collaborator
There was a problem hiding this comment.
nit: It would be more readable if we made this multi-line.
| constexpr std::string_view json = | ||
| R"({"fields":[{"id":1,"name":"mysteries","required":false,"type":{"key":"unknown","key-id":2,"type":"map","value":"string","value-id":3,"value-required":false}}],"schema-id":1,"type":"struct"})"; | ||
|
|
||
| auto schema_result = SchemaFromJson(nlohmann::json::parse(json)); |
Collaborator
There was a problem hiding this comment.
From the spec: Map keys are required and map values can be either optional or required. So I'm wondering should we report something like Map 'key' can not be unknown type rather than the current error msg?
| ICEBERG_ASSIGN_OR_RAISE(auto value_id, GetJsonValue<int32_t>(json, kValueId)); | ||
| ICEBERG_ASSIGN_OR_RAISE(auto value_required, GetJsonValue<bool>(json, kValueRequired)); | ||
|
|
||
| ICEBERG_RETURN_UNEXPECTED( |
Collaborator
There was a problem hiding this comment.
Maybe we can restrict key_type can't be unknown here, then we don't need to call ValidateUnknownFieldOptional for key_type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #665
Summary
Validation
Co-authored-by: @codex