ritesh-kapoor commented on a change in pull request #1733: [CALCITE-3679] Allow 
lambda expressions in SQL queries
URL: https://github.com/apache/calcite/pull/1733#discussion_r401331638
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java
 ##########
 @@ -304,6 +305,17 @@ private SqlLibraryOperators() {
           OperandTypes.CHARACTER,
           SqlFunctionCategory.STRING);
 
+  @LibraryOperator(libraries = {MYSQL})
+  public static final SqlFunction MAP_FILTER =
+      new SqlFunction("MAP_FILTER",
+          SqlKind.OTHER_FUNCTION,
+          ReturnTypes.cascade(ReturnTypes.ARG0, SqlTypeTransforms.TO_NULLABLE),
+          null,
+          OperandTypes.sequence("MAP_FILTER(<ANY>, <LAMBDA(BOOLEAN, ANY, 
ANY)>)",
+              OperandTypes.family(SqlTypeFamily.MAP),
+              OperandTypes.lambda(SqlTypeFamily.BOOLEAN, SqlTypeFamily.ANY, 
SqlTypeFamily.ANY)),
+          SqlFunctionCategory.SYSTEM);
 
 Review comment:
   The Map Function accepts lambda which returns boolean value and takes two 
arguments of any type. This seems to be correct.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to