flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] lirui-apache commented on a change in pull request #9927: [FLINK-14397][hive] Failed to run Hive UDTF with array arguments
Date Tue, 22 Oct 2019 03:06:03 GMT
lirui-apache 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_r337316929
 
 

 ##########
 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:
   Not sure whether we have to disable it in the util methods. It's a known limitation documented
[here](https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/table/hive/#limitations).
So users shouldn't be using it in the first place.
   Also remembered we already have a JIRA for the bridged types: https://issues.apache.org/jira/browse/FLINK-13438
and we can continue the work there.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message