rdblue commented on a change in pull request #1478:
URL: https://github.com/apache/iceberg/pull/1478#discussion_r496313414



##########
File path: 
mr/src/main/java/org/apache/iceberg/mr/hive/serde/objectinspector/IcebergObjectInspector.java
##########
@@ -72,7 +75,20 @@ public ObjectInspector primitive(Type.PrimitiveType 
primitiveType) {
         primitiveTypeInfo = TypeInfoFactory.booleanTypeInfo;
         break;
       case DATE:
-        return IcebergDateObjectInspector.get();
+        // create the correct inspector based on whether we're working with 
Hive2 or Hive3 dependencies
+        // we need to do this because there is a breaking API change in 
DateObjectInspector between Hive2 and Hive3
+        if (MetastoreUtil.hive3PresentOnClasspath()) {

Review comment:
       And, translating these to use `DynMethods` would make it cleaner. I 
think both paths should use reflection and that's easy with `DynMethods`. You 
just provide multiple `impl` calls and the first one that is found will be used.




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



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

Reply via email to