manirajv06 commented on code in PR #13195: URL: https://github.com/apache/iceberg/pull/13195#discussion_r2211108889
########## api/src/main/java/org/apache/iceberg/expressions/VariantExpressionUtil.java: ########## @@ -111,8 +113,19 @@ static <T> T castTo(VariantValue value, Type type) { } break; - } + case TIMESTAMP: + case TIMESTAMP_NANO: + case TIME: + if (value.type() == PhysicalType.INT64) { + return (T) (Long) ((Number) value.asPrimitive().get()).longValue(); + } + break; + case UUID: Review Comment: My understanding is, UUID has been stored as STRING type not as UUID in Variant. Let's say, "abc" has been stored in Variant::event_id. But when tried to extract using UUID as type with some UUID value something like extract ("variant", "$.event_uuid", UUID), "SOME UUID VALUE"), then it would throw "Invalid UUID" exception as "abc" is not a valid UUID. Is this correct? Can we return "null" when the stored value ( "abc" ) is not a valid UUID? -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org