VasShabu commented on code in PR #28970:
URL: https://github.com/apache/flink/pull/28970#discussion_r3933194138
##########
flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/inference/InputTypeStrategiesTest.java:
##########
@@ -644,6 +644,43 @@ ANY, explicit(DataTypes.INT())
.expectArgumentTypes(
DataTypes.ARRAY(DataTypes.INT().notNull()).notNull(),
DataTypes.INT()),
+ TestSpec.forStrategy(
+ "MapKey argument type strategy implicitly
casts the key",
+ sequence(
+ logical(LogicalTypeRoot.MAP),
+
SpecificInputTypeStrategies.MAP_KEY_ARG))
+ .calledWithArgumentTypes(
+ DataTypes.MAP(DataTypes.BIGINT().notNull(),
DataTypes.STRING()),
+ DataTypes.INT().notNull())
+ .expectSignature("f(<MAP>, <MAP KEY>)")
+ .expectArgumentTypes(
+ DataTypes.MAP(DataTypes.BIGINT().notNull(),
DataTypes.STRING()),
+ DataTypes.BIGINT().notNull()),
+ TestSpec.forStrategy(
+ "MapKey argument type strategy widens a NOT
NULL key type "
+ + "for a nullable argument",
+ sequence(
+ logical(LogicalTypeRoot.MAP),
+
SpecificInputTypeStrategies.MAP_KEY_ARG))
+ .calledWithArgumentTypes(
+ DataTypes.MAP(DataTypes.BIGINT().notNull(),
DataTypes.STRING())
+ .notNull(),
+ DataTypes.BIGINT())
+ .expectArgumentTypes(
+ DataTypes.MAP(DataTypes.BIGINT().notNull(),
DataTypes.STRING())
+ .notNull(),
+ DataTypes.BIGINT()),
+ TestSpec.forStrategy(
+ "MapKey argument type strategy rejects a key
that cannot be cast",
+ sequence(
+ logical(LogicalTypeRoot.MAP),
+
SpecificInputTypeStrategies.MAP_KEY_ARG))
+ .calledWithArgumentTypes(
+ DataTypes.MAP(DataTypes.INT(),
DataTypes.STRING()),
+ DataTypes.BOOLEAN())
+ .expectErrorMessage(
+ "Invalid input arguments. Expected signatures
are:\n"
Review Comment:
ah yes, I forgot to run the inputTypeStrategiesTest, before commiting I ran
mapFunctionITCases, will make sure I run all tests relating to a feature prior
to commit.
--
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]