You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/01/07 07:34:44 UTC

[GitHub] [flink] wuchong commented on a change in pull request #10775: [FLINK-15482][hive] Failed to call Hive functions returning decimal type

wuchong commented on a change in pull request #10775: [FLINK-15482][hive] Failed to call Hive functions returning decimal type
URL: https://github.com/apache/flink/pull/10775#discussion_r363619388
 
 

 ##########
 File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/DataFormatConverters.java
 ##########
 @@ -164,9 +164,10 @@ public static DataFormatConverter getConverterForDataType(DataType originDataTyp
 				Tuple2<Integer, Integer> ps = getPrecision(logicalType);
 				if (clazz == BigDecimal.class) {
 					return new BigDecimalConverter(ps.f0, ps.f1);
-				} else {
+				} else if (clazz == Decimal.class) {
 					return new DecimalConverter(ps.f0, ps.f1);
 				}
+				throw new RuntimeException("Not support class for DECIMAL: " + clazz);
 
 Review comment:
   Put it in the `else` branch? Could you help to update other types which have the same problem, e.g. `TIMESTAMP_WITHOUT_TIME_ZONE`, `TIMESTAMP_WITH_LOCAL_TIME_ZONE`, `TIMESTAMP_WITH_LOCAL_TIME_ZONE`...

----------------------------------------------------------------
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