liuyongvs commented on code in PR #3238:
URL: https://github.com/apache/calcite/pull/3238#discussion_r1241086232
##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -4003,6 +4004,33 @@ 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()) {
Review Comment:
@NobiGo yeap. the calcite supports NullPolicy(6 policy), which will insert
code in runtime, spark using NullIntolerant(only one policy), which is equal
to NullPolicy.
for example:
if the NullPolicy.ANY, the calcite will return null If any of the arguments
are null. so the user code doesn't need check whether the input is null
```
defineMethod(MAP_FROM_ARRAYS, BuiltInMethod.MAP_FROM_ARRAYS.method,
NullPolicy.ANY);
```
--
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]