[ 
https://issues.apache.org/jira/browse/BEAM-4167?focusedWorklogId=104815&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-104815
 ]

ASF GitHub Bot logged work on BEAM-4167:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/May/18 21:44
            Start Date: 22/May/18 21:44
    Worklog Time Spent: 10m 
      Work Description: akedin commented on a change in pull request #5428: 
[BEAM-4167] Implement UNNEST
URL: https://github.com/apache/beam/pull/5428#discussion_r190063251
 
 

 ##########
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/interpreter/operator/BeamSqlCorrelVariableExpression.java
 ##########
 @@ -0,0 +1,56 @@
+/*
+ * 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.beam.sdk.extensions.sql.impl.interpreter.operator;
+
+import static com.google.common.base.Preconditions.checkState;
+
+import com.google.common.collect.ImmutableMap;
+import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
+import org.apache.beam.sdk.values.Row;
+import org.apache.calcite.sql.type.SqlTypeName;
+
+/** A primitive operation for deferencing a correlation variable. */
+public class BeamSqlCorrelVariableExpression extends BeamSqlExpression {
+
+  private final int correlationId;
+
+  public BeamSqlCorrelVariableExpression(SqlTypeName sqlTypeName, int 
correlationId) {
+    super(null, sqlTypeName);
+    this.correlationId = correlationId;
+  }
+
+  @Override
+  public boolean accept() {
+    return true;
+  }
+
+  @Override
+  public BeamSqlPrimitive evaluate(
+      Row inputRow, BoundedWindow window, ImmutableMap<Integer, Object> 
correlateEnv) {
 
 Review comment:
   I see. Would it work for complex cases, like multiple nested correlated 
queries? What the plan would look like? I don't see where this is handled, 
maybe I missed it.
   
   If not, then it probably makes sense to comment on correlation logic that 
it's only there to support unnest and is limited. And is there a need for a map 
in this case? Wouldn't a single id work?
   
   And should we wrap the map into some kind of execution context class?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 104815)
    Time Spent: 2h 10m  (was: 2h)

> Implement UNNEST
> ----------------
>
>                 Key: BEAM-4167
>                 URL: https://issues.apache.org/jira/browse/BEAM-4167
>             Project: Beam
>          Issue Type: New Feature
>          Components: dsl-sql
>            Reporter: Anton Kedin
>            Assignee: Kenneth Knowles
>            Priority: Major
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> We need to be able to convert collections to relations in the query to 
> perform any meaningful operations on them. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to