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 2023/01/11 15:09:06 UTC

[GitHub] [flink] lsyldliu commented on a diff in pull request #21629: [FLINK-30579][hive] Introducing cofigurable option to enable hive native function

lsyldliu commented on code in PR #21629:
URL: https://github.com/apache/flink/pull/21629#discussion_r1067108838


##########
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/functions/hive/HiveSumAggFunction.java:
##########
@@ -125,10 +126,16 @@ private DataType initResultType(DataType argsType) {
                 int precision =
                         Math.min(MAX_PRECISION, getPrecision(argsType.getLogicalType()) + 10);
                 return DataTypes.DECIMAL(precision, getScale(argsType.getLogicalType()));
+            case TIMESTAMP_WITHOUT_TIME_ZONE:
+                throw new TableException(
+                        String.format(
+                                "Native hive sum aggregate function does not support type: '%s'. Please set option '%s' to false.",
+                                argsType.getLogicalType().getTypeRoot(),
+                                TABLE_EXEC_HIVE_NATIVE_AGG_FUNCTION_ENABLED.key()));
             default:
                 throw new TableException(
                         String.format(
-                                "Sum aggregate function does not support type: '%s'. Please re-check the data type.",
+                                "Native hive sum aggregate function does not support type: '%s'. Please re-check the data type.",

Review Comment:
   For the `TIMESTAMP_WITHOUT_TIME_ZONE ` type, hive sum udaf supports it, but flink can't support, but for default case type, hive  sum udaf and flink both can't support it, so I think should distinguish these two case, the exception shouldn't be same.



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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org