snuyanzin commented on code in PR #21993:
URL: https://github.com/apache/flink/pull/21993#discussion_r1117821456
##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/strategies/ArrayElementArgumentTypeStrategy.java:
##########
@@ -31,24 +31,28 @@
import java.util.Optional;
-import static
org.apache.flink.table.types.logical.utils.LogicalTypeCasts.supportsImplicitCast;
-
/** Specific {@link ArgumentTypeStrategy} for {@link
BuiltInFunctionDefinitions#ARRAY_CONTAINS}. */
@Internal
class ArrayElementArgumentTypeStrategy implements ArgumentTypeStrategy {
+ private final boolean preserveNullability;
+
+ public ArrayElementArgumentTypeStrategy(boolean preserveNullability) {
+ this.preserveNullability = preserveNullability;
+ }
+
@Override
public Optional<DataType> inferArgumentType(
CallContext callContext, int argumentPos, boolean throwOnFailure) {
final ArrayType haystackType =
(ArrayType)
callContext.getArgumentDataTypes().get(0).getLogicalType();
final LogicalType haystackElementType = haystackType.getElementType();
- final LogicalType needleType =
-
callContext.getArgumentDataTypes().get(argumentPos).getLogicalType();
- if (supportsImplicitCast(needleType, haystackElementType)) {
Review Comment:
Based on the Contract for
`org.apache.flink.table.types.inference.ArgumentTypeStrategy#inferArgumentType`
it should return an empty value in case input type could not be inferred.
Right not this change violates this contract
https://github.com/apache/flink/blob/464ded1c2a0497255b70f711167c3b7ae52ea0f7/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/ArgumentTypeStrategy.java#L33-L48
--
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]