liuyongvs commented on code in PR #3238:
URL: https://github.com/apache/calcite/pull/3238#discussion_r1215556292
##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -3917,6 +3918,38 @@ public static List mapValues(Map map) {
return new ArrayList<>(map.values());
}
+ /** Support the MAP_FROM_ARRAYS function. */
+ public static Map mapFromArrays(List keysArray, List valuesArray) {
+ if (keysArray.size() != valuesArray.size()) {
+ throw new IllegalArgumentException(
Review Comment:
the length check is need, and i add a negative test for it
```
f.checkFails("map_from_arrays(array[1, 2], array['foo'])",
"Invalid function MAP_FROM_ARRAYS call:\n"
+ "The length of the keys array 2 is not equal to the length of
the values array 1",
true);
```
--
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]