Aggarwal-Raghav commented on PR #6242:
URL: https://github.com/apache/hive/pull/6242#issuecomment-3697164807

   > For classes like `IcebergNanosecondTimestampObjectInspectorHive3, 
IcebergNanosecondTimestampWithZoneObjectInspectorHive3` , we need to override 
methods like `getPrimitiveJavaObject, getPrimitiveWritableObject` etc, they 
should return specific subclass like TimestampNanoTZ or TimestampNano
   
   Any thoughts on this comments? This is what I meant:
   ```
   package org.apache.iceberg.mr.hive.serde.objectinspector;
   
   import java.time.LocalDateTime;
   import org.apache.hadoop.hive.common.type.TimestampNano;
   import org.junit.jupiter.api.Assertions;
   import org.junit.jupiter.api.Test;
   
   public class TestIcebergNanosecondTimestampObjectInspectorHive3 {
   
     @Test
     public void testScenario() {
       IcebergNanosecondTimestampObjectInspectorHive3 oi =
           IcebergNanosecondTimestampObjectInspectorHive3.get();
       LocalDateTime now = LocalDateTime.now();
   
       Object tempObject = oi.getPrimitiveJavaObject(now);
   
       Assertions.assertInstanceOf(
           TimestampNano.class,
           tempObject,
           "getPrimitiveJavaObject should return an instance of TimestampNano");
     }
   ```
   ```
   [ERROR]   TestIcebergNanosecondTimestampObjectInspectorHive3.testScenario:37 
getPrimitiveJavaObject should return an instance of TimestampNano ==> 
Unexpected type, expected: <org.apache.hadoop.hive.common.type.TimestampNano> 
but was: <org.apache.hadoop.hive.common.type.Timestamp>
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to