aokolnychyi commented on a change in pull request #506: Handling Date type 
conversion as epochDay integer ordinal 
URL: https://github.com/apache/incubator-iceberg/pull/506#discussion_r329664947
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/types/Conversions.java
 ##########
 @@ -66,6 +68,8 @@ public static Object fromPartitionString(Type type, String 
asString) {
         return asString.getBytes(StandardCharsets.UTF_8);
       case DECIMAL:
         return new BigDecimal(asString);
+      case DATE:
+        return (int) LocalDate.parse(asString, 
DateTimeFormatter.ofPattern("yyyy-MM-dd")).toEpochDay();
 
 Review comment:
   As an option, we can also rely on Iceberg here:
   ```
   Literal.of(asString).to(Types.DateType.get()).value();
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to