twalthr commented on code in PR #29416:
URL: https://github.com/apache/flink/pull/29416#discussion_r4359837907
##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/strategies/CommonCollectionInputTypeStrategy.java:
##########
@@ -88,10 +98,13 @@ public Optional<List<DataType>> inferInputTypes(
argumentDataTypes);
}
- return commonType.map(
- type ->
- Collections.nCopies(
- argumentTypes.size(),
TypeConversions.fromLogicalToDataType(type)));
+ final DataType commonDataType =
TypeConversions.fromLogicalToDataType(commonType.get());
+ if (requiresElementEquality) {
+ return
EqualsComparableElementArgumentTypeStrategy.checkElementEquality(
Review Comment:
```suggestion
return
ComparableElementArgumentTypeStrategy.checkElementEquality(
```
at least a bit shorter?
##########
docs/content.zh/docs/sql/reference/data-types.md:
##########
@@ -1736,6 +1736,11 @@ one, where it compares values:
argument
- as an operand of a comparison such as `=`, `<>`, `<`, `IS DISTINCT FROM`, or
`IN`, which includes
join conditions
+- as the array element or map key that a function compares, as in
`ARRAY_CONTAINS`,
Review Comment:
We don't need to list all possible cases where comparision can happen. This
list is never complete and soon outdated anyways. Can you compact the entire
list, some examples should be sufficient.
##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/strategies/CommonCollectionInputTypeStrategy.java:
##########
@@ -88,10 +98,13 @@ public Optional<List<DataType>> inferInputTypes(
argumentDataTypes);
}
- return commonType.map(
- type ->
- Collections.nCopies(
- argumentTypes.size(),
TypeConversions.fromLogicalToDataType(type)));
+ final DataType commonDataType =
TypeConversions.fromLogicalToDataType(commonType.get());
+ if (requiresElementEquality) {
+ return
EqualsComparableElementArgumentTypeStrategy.checkElementEquality(
Review Comment:
```suggestion
return
ComparableElementArgumentTypeStrategy.checkElementEquality(
```
at least a bit shorter?
--
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]