You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "dawidwys (via GitHub)" <gi...@apache.org> on 2023/06/12 16:02:51 UTC
[GitHub] [flink] dawidwys commented on a diff in pull request #22730: [FLINK-32257]-table-Add-ARRAY_MAX-function
dawidwys commented on code in PR #22730:
URL: https://github.com/apache/flink/pull/22730#discussion_r1226894432
##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/BuiltInFunctionDefinitions.java:
##########
@@ -272,6 +281,61 @@ ANY, and(logical(LogicalTypeRoot.BOOLEAN), LITERAL)
"org.apache.flink.table.runtime.functions.scalar.ArrayUnionFunction")
.build();
+ public static final BuiltInFunctionDefinition ARRAY_MAX =
+ BuiltInFunctionDefinition.newBuilder()
+ .name("ARRAY_MAX")
+ .kind(SCALAR)
+ .inputTypeStrategy(
+ new InputTypeStrategy() {
Review Comment:
Yes, we should have that in a separate class.
BTW, I don't think the current implementation checks comparability in the right way. You can take a look (and probably reuse a lot of) at https://github.com/confluentinc/flink/blob/ff7a0f6f25748933729bc94038444b3d4e233315/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/strategies/ComparableTypeStrategy.java#L59
I'd try to extract as much of the logic from there and reuse it.
In the end I believe we should strive to have something similar to: https://github.com/confluentinc/flink/blob/ff7a0f6f25748933729bc94038444b3d4e233315/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/strategies/ConstraintArgumentTypeStrategy.java#L35 where the constraint is applied to array's argument.
--
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