dawidwys commented on code in PR #22951:
URL: https://github.com/apache/flink/pull/22951#discussion_r1487826357
##########
flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/inference/InputTypeStrategiesTest.java:
##########
@@ -640,6 +640,28 @@ ANY, explicit(DataTypes.INT())
.expectArgumentTypes(
DataTypes.ARRAY(DataTypes.INT().notNull()).notNull(),
DataTypes.INT()),
+
TestSpec.forStrategy(sequence(SpecificInputTypeStrategies.ARRAY_COMPARABLE))
+ .expectSignature("f(<ARRAY<COMPARABLE>>)")
+
.calledWithArgumentTypes(DataTypes.ARRAY(DataTypes.ROW()))
+ .expectErrorMessage(
+ "Invalid input arguments. Expected signatures
are:\n"
+ + "f(<ARRAY<COMPARABLE>>)"),
+ TestSpec.forStrategy(
+ "Strategy fails if input argument type is not
ARRAY",
+
sequence(SpecificInputTypeStrategies.ARRAY_COMPARABLE))
+ .calledWithArgumentTypes(DataTypes.INT())
+ .expectErrorMessage(
+ "Invalid input arguments. Expected signatures
are:\n"
+ + "f(<ARRAY<COMPARABLE>>)"),
+ TestSpec.forStrategy(
+ "Strategy fails if the number of input
arguments are not one",
+
sequence(SpecificInputTypeStrategies.ARRAY_COMPARABLE))
+ .calledWithArgumentTypes(
+ DataTypes.ARRAY(DataTypes.INT()),
+ DataTypes.ARRAY(DataTypes.STRING()))
+ .expectErrorMessage(
+ "Invalid input arguments. Expected signatures
are:\n"
+ + "f(<ARRAY<COMPARABLE>>)"),
Review Comment:
Sorry, I was not clear enough. I meant we don't need to test
`sequence(SpecificInputTypeStrategies.ARRAY_COMPARABLE)` takes a single
argument. We don't need to test that, because that's a property of the
`sequence`, whatever we use here instead of
`SpecificInputTypeStrategies.ARRAY_COMPARABLE` does not really matter.
The other two cases make total sense and you do it the right way! 👍
--
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]