Skip to content

Commit

Permalink
[FLINK-22484][table] add case with null for map_from_arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
snuyanzin committed Mar 7, 2023
1 parent e51024a commit cf6af30
Showing 1 changed file with 8 additions and 3 deletions.
Expand Up @@ -239,8 +239,8 @@ Stream<TestSetSpec> getTestSetSpecs() {
TestSetSpec.forFunction(BuiltInFunctionDefinitions.MAP_FROM_ARRAYS, "Invalid input")
.onFieldsWithData(null, null, new Integer[] {1}, new Integer[] {1, 2})
.andDataTypes(
DataTypes.BOOLEAN().nullable(),
DataTypes.INT().nullable(),
DataTypes.ARRAY(DataTypes.BOOLEAN()),
DataTypes.ARRAY(DataTypes.STRING()),
DataTypes.ARRAY(DataTypes.INT()),
DataTypes.ARRAY(DataTypes.INT()))
.testTableApiRuntimeError(
Expand All @@ -250,7 +250,12 @@ Stream<TestSetSpec> getTestSetSpecs() {
.testSqlRuntimeError(
"MAP_FROM_ARRAYS(array[1, 2, 3], array[1, 2])",
"Invalid function MAP_FROM_ARRAYS call:\n"
+ "The length of the keys array 3 is not equal to the length of the values array 2"),
+ "The length of the keys array 3 is not equal to the length of the values array 2")
.testResult(
mapFromArrays($("f0"), $("f1")),
"MAP_FROM_ARRAYS(f0, f1)",
null,
DataTypes.MAP(DataTypes.BOOLEAN(), DataTypes.STRING())),
TestSetSpec.forFunction(BuiltInFunctionDefinitions.MAP_FROM_ARRAYS)
.onFieldsWithData(
new Integer[] {1, 2},
Expand Down

0 comments on commit cf6af30

Please sign in to comment.