mihaibudiu commented on code in PR #5042:
URL: https://github.com/apache/calcite/pull/5042#discussion_r3464529015
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -9244,16 +9244,19 @@ void checkArrayReverseFunc(SqlOperatorFixture f0,
SqlFunction function,
// test only has one operand, but it is not map type.
f.checkFails("^map_concat(1)^",
- "Function 'MAP_CONCAT' should all be of type map, but it is 'INTEGER
NOT NULL'", false);
- f.checkFails("^map_concat(null)^",
- "Function 'MAP_CONCAT' should all be of type map, but it is 'NULL'",
false);
+ "Arguments of function 'MAP_CONCAT' should all be of type MAP, "
+ + "but 'INTEGER NOT NULL' was found", false);
+ // test operand is the NULL literal.
+ f.checkNull("map_concat(null)");
// test operands in same type family, but it is not map type.
f.checkFails("^map_concat(array[1], array[1])^",
- "Function 'MAP_CONCAT' should all be of type map, "
- + "but it is 'INTEGER NOT NULL ARRAY NOT NULL'", false);
- f.checkFails("^map_concat(map['foo', 1], null)^",
- "Function 'MAP_CONCAT' should all be of type map, "
- + "but it is 'NULL'", false);
+ "Arguments of function 'MAP_CONCAT' should all be of type MAP, "
+ + "but 'INTEGER NOT NULL ARRAY NOT NULL' was found", false);
+ // test map operand with NULL literal.
+ f.checkNull("map_concat(map['foo', 1], null)");
+ f.checkType("map_concat(map['foo', 1], null)",
Review Comment:
Why would the type change if you infer it to be NULL?
--
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]