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_r337627904
##########
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:
Flink timestamp can have a higher precision than Hive's, why converting Hive
timestamp to Flink's doesn't work? Seems we need to be cautious when converting
Flink timestamp to Hive's, right?
----------------------------------------------------------------
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