[GitHub] [flink] lirui-apache commented on a change in pull request #9995: [FLINK-14526][hive] Support Hive version 1.1.0 and 1.1.1

2019-10-28 Thread GitBox
lirui-apache commented on a change in pull request #9995: [FLINK-14526][hive] 
Support Hive version 1.1.0 and 1.1.1
URL: https://github.com/apache/flink/pull/9995#discussion_r339872502
 
 

 ##
 File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShim.java
 ##
 @@ -33,16 +36,18 @@
 import org.apache.hadoop.hive.metastore.api.UnknownDBException;
 import org.apache.hadoop.hive.ql.udf.generic.SimpleGenericUDAFParameterInfo;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
+import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo;
 import org.apache.thrift.TException;
 
 import java.io.IOException;
+import java.io.Serializable;
 import java.util.List;
 import java.util.Map;
 
 /**
  * A shim layer to support different versions of Hive.
  */
-public interface HiveShim {
+public interface HiveShim extends Serializable {
 
 Review comment:
   Tests pass before this PR only because we don't have enough test coverage to 
expose the issue. Before this PR, HiveShim is only used to get object 
inspectors for DATE and TIMESTAMP columns, while with the PR, HiveShim is 
needed for all columns. So we need the fix to pass the tests.


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


With regards,
Apache Git Services


[GitHub] [flink] lirui-apache commented on a change in pull request #9995: [FLINK-14526][hive] Support Hive version 1.1.0 and 1.1.1

2019-10-28 Thread GitBox
lirui-apache commented on a change in pull request #9995: [FLINK-14526][hive] 
Support Hive version 1.1.0 and 1.1.1
URL: https://github.com/apache/flink/pull/9995#discussion_r339412850
 
 

 ##
 File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShimV120.java
 ##
 @@ -194,4 +200,108 @@ public void makeSpecFromName(Map 
partSpec, Path currPath) {
}
}
 
+   @Override
+   public ObjectInspector getObjectInspectorForConstant(PrimitiveTypeInfo 
primitiveTypeInfo, Object value) {
+   String className;
+   switch (primitiveTypeInfo.getPrimitiveCategory()) {
+   case BOOLEAN:
+   className = 
"org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaConstantBooleanObjectInspector";
 
 Review comment:
   Because java constant object inspectors are not available until 1.2.0


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


With regards,
Apache Git Services