feat: add PrimitiveType::Variant to iceberg spec#2423
Conversation
6c6f490 to
6265b88
Compare
6265b88 to
3c86956
Compare
|
This have some overlap with #2188 but its is minimal start. |
b581777 to
3c86956
Compare
|
I have followup changes in progress : |
|
Final plan: |
00019c9 to
14e91d5
Compare
| Ok(glue_type) | ||
| } | ||
|
|
||
| fn variant(&mut self, _v: &iceberg::spec::VariantType) -> iceberg::Result<String> { |
There was a problem hiding this comment.
We will work on this in follow up PRs
| Ok(hive_type) | ||
| } | ||
|
|
||
| fn variant(&mut self, _v: &iceberg::spec::VariantType) -> iceberg::Result<String> { |
There was a problem hiding this comment.
We will work on this in follow up PRs
| ) -> crate::Result<ArrowSchemaOrFieldOrType> { | ||
| Err(crate::Error::new( | ||
| crate::ErrorKind::FeatureUnsupported, | ||
| "Arrow schema conversion for Variant is not yet implemented", |
There was a problem hiding this comment.
We will work on this in follow up PRs
| fn variant(&mut self, _v: &VariantType, _partner: &ArrayRef) -> Result<Vec<Option<Literal>>> { | ||
| Err(Error::new( | ||
| ErrorKind::FeatureUnsupported, | ||
| "Arrow value extraction for Variant is not yet implemented", |
There was a problem hiding this comment.
We will work on this in follow up PRs
| } else { | ||
| self.name_to_id.insert(full_name, field_id); | ||
| } | ||
| self.insert_current_path() |
There was a problem hiding this comment.
just a refactor
|
Updated the branch Please have a look @nssalian @mbutrovich |
|
@Shekharrajak is this the same as #2188? That change has one approval already. |
|
I think we should rally behind #2188 since it's already gone through review rounds and is approved. |
Which issue does this PR close?
#2411
What changes are included in this PR?
• Adds PrimitiveType::Variant to the Iceberg type system (spec v3)
• Implements Display — serializes as "variant" per Iceberg spec
• Implements compatible() — returns false for all literals (no scalar predicate against Variant)
• Adds Avro mapping — AvroSchema::Bytes (opaque, no natural Avro equivalent)
• Adds PrimitiveType::Variant to the canonical primitive_type_serde test
• Adds targeted tests: Display output, serde round-trip, literal incompatibility
Are these changes tested?
Unit tests
What this PR does NOT do (follow-up):
• Arrow schema mapping (DataType::Struct + VariantType extension)
• arrow_field_to_type reverse mapping
• Metrics evaluator statistics suppression
• Iceberg scan/write path support