laskoviymishka opened a new issue, #2081:
URL: https://github.com/apache/iceberg-go/issues/2081

   `VariantLiteral.To` returns itself when the target is a `VariantType` and 
rejects every other target with `ErrBadCast`, even when the underlying 
`variant.Value` holds a primitive (int, string, bool, timestamp, ...) that maps 
cleanly onto an Iceberg literal. A `TODO` on the method already flags this.
   
   Read the underlying value's type via `variant.Value.Type()`; when it is a 
primitive, construct the matching `Literal` and delegate to that literal's 
`To(typ)` so the existing cast rules apply. Keep returning `ErrBadCast` for 
object/array variants and for genuinely incompatible targets.
   
   The `Equals` byte-comparison `TODO` just below is a separate follow-up 
(blocked on an upstream `parquet/variant` `Equal`) and is out of scope here.
   
   Tests: a few primitive variants converting to their matching type and to a 
compatible type through the delegated cast, plus an object/array variant and an 
incompatible target both still returning `ErrBadCast`.
   


-- 
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