julianhyde commented on code in PR #3909:
URL: https://github.com/apache/calcite/pull/3909#discussion_r1710422025
##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -5682,11 +5682,21 @@ public static List mapEntries(Map<Object, Object> map) {
/** Support the MAP_KEYS function. */
public static List mapKeys(Map map) {
+ for (Object key : map.keySet()) {
Review Comment:
On reflection, I think you should use `ImmutableList.copyOf(map.keySet())`.
Immutable lists are better, and this will be a quick operation if map is an
`ImmutableMap`.
Before doing this, use `map.keySet().contains(null)`. It's more efficient
than your `for` loop.
--
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]