liuyongvs commented on code in PR #3194:
URL: https://github.com/apache/calcite/pull/3194#discussion_r1189758110
##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -3797,6 +3798,16 @@ public static List distinct(List list) {
return new ArrayList<>(result);
}
+ /** Support the MAP_KEYS function. */
+ public static List mapKeys(Map map) {
+ return (List) map.keySet().stream().collect(Collectors.toList());
Review Comment:
and why i doesn't add unit test map_keys(cast(null as map[keyType,
valueType])) is because the calcite doesn't supported, which you can see here
https://github.com/apache/calcite/pull/3189
java.lang.RuntimeException: Error while parsing query: select
cast(map['washington', 1, null, 44] as map[CHAR(10), INTEGER NOT NULL>] from
(values (1))
at
org.apache.calcite.sql.test.AbstractSqlTester.parseAndValidate(AbstractSqlTester.java:157)
at
org.apache.calcite.sql.test.AbstractSqlTester.validateAndThen(AbstractSqlTester.java:248)
at
org.apache.calcite.sql.test.AbstractSqlTester.checkColumnType(AbstractSqlTester.java:177)
at org.apache.calcite.test.SqlValidatorFixture.columnType(
--
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]