bowenli86 commented on a change in pull request #9927: [FLINK-14397][hive]
Failed to run Hive UDTF with array arguments
URL: https://github.com/apache/flink/pull/9927#discussion_r337313749
##########
File path:
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/functions/hive/conversion/HiveInspectors.java
##########
@@ -450,4 +454,56 @@ private static ObjectInspector
getObjectInspector(TypeInfo type) {
public static DataType toFlinkType(ObjectInspector inspector) {
return
HiveTypeUtil.toFlinkType(TypeInfoUtils.getTypeInfoFromTypeString(inspector.getTypeName()));
}
+
+ // given a Hive ObjectInspector, get the class for corresponding Flink
object
+ private static Class<?> classForObjectInspector(ObjectInspector
inspector) {
+ switch (inspector.getCategory()) {
+ case PRIMITIVE: {
+ PrimitiveObjectInspector primitiveOI =
(PrimitiveObjectInspector) inspector;
+ switch (primitiveOI.getPrimitiveCategory()) {
+ case STRING:
+ case CHAR:
+ case VARCHAR:
+ return String.class;
+ case INT:
+ return Integer.class;
+ case LONG:
+ return Long.class;
+ case BYTE:
+ return Byte.class;
+ case SHORT:
+ return Short.class;
+ case FLOAT:
+ return Float.class;
+ case DOUBLE:
+ return Double.class;
+ case DECIMAL:
+ return BigDecimal.class;
+ case BOOLEAN:
+ return Boolean.class;
+ case BINARY:
+ return byte[].class;
+ case DATE:
+ return Date.class;
+ case TIMESTAMP:
Review comment:
If so, we may need to disable support for timestamp in all util methods in
HiveInspectors, instead of just this one. Can you create a jira to do it?
----------------------------------------------------------------
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]
With regards,
Apache Git Services