eneskeles commented on code in PR #2088:
URL: https://github.com/apache/iceberg-go/pull/2088#discussion_r4159177967


##########
variant_cast.go:
##########
@@ -281,3 +278,35 @@ func literalFromCastValue(result any) Literal {
 
        return nil
 }
+
+func literalFromVariant(v variant.Value) (Literal, bool) {
+       // a zero Value has no header byte to read a type from
+       if len(v.Bytes()) == 0 {
+               return nil, false
+       }
+
+       raw := v.Value()
+       switch v.Type() {
+       case variant.Int8:
+               return Int32Literal(raw.(int8)), true
+       case variant.Int16:
+               return Int32Literal(raw.(int16)), true
+       case variant.Date:
+               return DateLiteral(raw.(arrow.Date32)), true
+       case variant.Time:
+               return TimeLiteral(raw.(arrow.Time64)), true
+       case variant.TimestampMicros, variant.TimestampMicrosNTZ:
+               return TimestampLiteral(raw.(arrow.Timestamp)), true
+       case variant.TimestampNanos, variant.TimestampNanosNTZ:
+               return TimestampNsLiteral(raw.(arrow.Timestamp)), true

Review Comment:
   Added this as comment



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