danny0405 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_r396053902
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rex/RexLambdaRef.java
 ##########
 @@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.calcite.rex;
+
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeField;
+import org.apache.calcite.sql.SqlKind;
+import org.apache.calcite.util.Pair;
+
+import java.util.List;
+
+/**
+ * Variable which references a parameter in lambda expression.
+ *
+ * <p>Fields of the input are 0-based. If there is more than one input, they 
are
+ * numbered consecutively. For example</p>
+ *
+ * (a,b)-&gt;{expression}
+ *
+ * <p>then the fields are:</p>
+ *
+ * <ul>
+ * <li>Field #0: a</li>
+ * <li>Field #1: b</li>
+ * </ul>
+ *
+ * <p>So <code>RexLambdaRef(0, Integer)</code> is the correct reference for the
+ * field a.</p>
+ */
+public class RexLambdaRef extends RexSlot {
+  //~ Static fields/initializers ---------------------------------------------
 
 Review comment:
   Isn't is just a `RexLocalRef` ?

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