You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2023/01/10 16:51:54 UTC

[GitHub] [iceberg] rdblue commented on a diff in pull request #6548: Core: Add timestamp handling to GenericRecord

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


##########
core/src/main/java/org/apache/iceberg/data/GenericRecord.java:
##########
@@ -115,15 +120,27 @@ public Object get(int pos) {
   }
 
   @Override
+  @SuppressWarnings("unchecked")
   public <T> T get(int pos, Class<T> javaClass) {
     Object value = get(pos);
     if (value == null || javaClass.isInstance(value)) {
       return javaClass.cast(value);
+    }
+
+    if (value instanceof LocalDateTime) {

Review Comment:
   This is suspicious to me. Generics should not contain values that need to be converted when read. How would a `LocalDateTime`  get into a generic? Those values are supposed to be long in micros.



-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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