eneskeles opened a new pull request, #2088:
URL: https://github.com/apache/iceberg-go/pull/2088

   Fixes #2081
   
   `VariantLiteral.To` only accepted `VariantType` and rejected every other 
target, even when the variant held a primitive that maps onto an Iceberg 
literal.
   
   For a primitive variant, this builds the literal for the underlying value 
and delegates to that literal's `To`, so the existing cast rules apply. Variant 
int8 and int16 widen to `Int32Literal`. Null, object and array variants still 
return `ErrBadCast` for non-variant targets.
   
   `CastVariantLiteral`, used for predicate pushdown, keeps its strict rules. 
Its decimal conversion is split into `variantDecimal` so both paths share it; 
behaviour is unchanged.
   
   Java's `VariantLiteral.to` only supports `VARIANT`, and Rust, C++ and 
PyIceberg have no variant literal, so this goes beyond the other 
implementations, as requested in #2081.
   
   Tests: `TestVariantLiteralConversions` covers each primitive variant type 
and casts through the underlying literal; 
`TestInvalidVariantLiteralConversions` covers null, object and array variants 
and incompatible targets.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to