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 2020/11/25 14:28:02 UTC

[GitHub] [iceberg] kukuzidian commented on issue #1780: hive cli execute sql query hadoopcatalog table occurred timestamp type cast exception

kukuzidian commented on issue #1780:
URL: https://github.com/apache/iceberg/issues/1780#issuecomment-733739690


   1.  in iceberg 0.10.0 branch  IcebergTimestampObjectInspector.java  line 75 :
    public Object copyObject(Object o) {
       if (o == null) {
         return null;
       }
   
       Timestamp ts = (Timestamp) o;
       Timestamp copy = new Timestamp(ts.getTime());
       copy.setNanos(ts.getNanos());
       return copy;
     }
   
   2. but in iceberg master  branch  IcebergTimestampObjectInspector.java  line 75 :
   public Object copyObject(Object o) {
       if (o == null) {
         return null;
       }
   
       if (o instanceof Timestamp) {
         Timestamp ts = (Timestamp) o;
         Timestamp copy = new Timestamp(ts.getTime());
         copy.setNanos(ts.getNanos());
         return copy;
       } else if (o instanceof OffsetDateTime) {
         return OffsetDateTime.of(((OffsetDateTime) o).toLocalDateTime(), ((OffsetDateTime) o).getOffset());
       } else if (o instanceof LocalDateTime) {
         return LocalDateTime.of(((LocalDateTime) o).toLocalDate(), ((LocalDateTime) o).toLocalTime());
       } else {
         return o;
       }
     }
   
   
   so when i get this excpetion ,  i find code in master brach  is different from 0.10.0 branch. Then i use new code in master branch can read parquest file ok . so I guess this case already finshed in master . 
   
   
   
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



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