rdblue commented on code in PR #4525:
URL: https://github.com/apache/iceberg/pull/4525#discussion_r876056384


##########
api/src/main/java/org/apache/iceberg/expressions/Literals.java:
##########
@@ -419,6 +420,9 @@ static class TimeLiteral extends ComparableLiteral<Long> {
     public <T> Literal<T> to(Type type) {
       if (type.typeId() == Type.TypeID.TIME) {
         return (Literal<T>) this;
+      } else if (type.typeId() == Type.TypeID.STRING) {
+        return (Literal<T>) new StringLiteral(LocalTime.ofNanoOfDay(value() * 
1000)
+            .format(DateTimeFormatter.ISO_LOCAL_TIME));

Review Comment:
   I don't think this conversion should be done using literals. You can see how 
we're doing it here, but there is no need to change the `Literals` API. And 
there is certainly no need to add extra conversions to `Literals`. These are 
purposely limited.



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

Reply via email to