waterlx commented on a change in pull request #983:
URL: https://github.com/apache/incubator-iceberg/pull/983#discussion_r420217792



##########
File path: api/src/main/java/org/apache/iceberg/Accessors.java
##########
@@ -187,6 +206,47 @@ public String toString() {
     }
   }
 
+  private static class DateAccessor extends PositionAccessor {
+    private DateAccessor(int pos, Type type) {
+      super(pos, type);
+    }
+
+    @Override
+    public Object get(StructLike record) {
+      LocalDate value = record.get(position(), LocalDate.class);
+      return (int) ChronoUnit.DAYS.between(EPOCH_DAY, value);

Review comment:
       Does it make sense to have a separate PR to add those common functions 
into DateTimeUtil?




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



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

Reply via email to