luoyuxia commented on code in PR #21605:
URL: https://github.com/apache/flink/pull/21605#discussion_r1073173230
##########
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/functions/hive/HiveDeclarativeAggregateFunction.java:
##########
@@ -57,6 +63,27 @@ public TypeInference getTypeInference(DataTypeFactory
factory) {
.build();
}
+ protected void checkArgumentNum(List<DataType> arguments) {
+ if (arguments.size() != 1) {
+ throw new TableException("Exactly one argument is expected.");
+ }
+ }
+
+ protected void checkMinMaxArgumentType(LogicalType logicalType, String
functionName) {
+ // Flink doesn't support to compare nested type now, so here can't
support it, see
+ // ScalarOperatorGens#generateComparison for more detail
+ if (logicalType.is(LogicalTypeRoot.ARRAY)
+ || logicalType.is(LogicalTypeRoot.MAP)
+ || logicalType.is(LogicalTypeRoot.ROW)) {
+ throw new TableException(
+ String.format(
+ "Native hive %s aggregate function does not
support type: %s. Please set option '%s' to false.",
Review Comment:
nit: Will it better to tell why set the option to `false`? Something like
`Please set option '%s' to false to fall back to Hive's own %s aggregate`?
It depends on you, current exception message also looks good to me.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]