You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/03/12 03:33:40 UTC

[GitHub] [calcite] chunweilei commented on a change in pull request #1733: [CALCITE-3679] Allow lambda expressions in SQL queries

chunweilei 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_r391384551
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/sql/test/SqlOperatorBaseTest.java
 ##########
 @@ -4559,6 +4559,46 @@ private void checkNullOperand(SqlTester tester, String op) {
         });
   }
 
+  @Test public void testLambda() {
+    tester.checkType("(a)->2+2*a", "LAMBDA NOT NULL");
+    tester.checkType("(a,b)->a+b", "LAMBDA NOT NULL");
+    tester.checkType("(a,b,c)->2*a+b+c", "LAMBDA NOT NULL");
+  }
+
+  @Test public void testMapFilterFunc() {
+    final SqlTester tester = tester(SqlLibrary.MYSQL);
 
 Review comment:
   I think we should also add some negative tests. For instance, `tester.checkType("(b)->2+2*a")`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services