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

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

                Author: ASF GitHub Bot
            Created on: 17/Apr/19 06:29
            Start Date: 17/Apr/19 06:29
    Worklog Time Spent: 10m 
      Work Description: amaliujia commented on pull request #8301: [BEAM-7070] 
JOIN condition should accept field access
URL: https://github.com/apache/beam/pull/8301#discussion_r276095181
 
 

 ##########
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamJoinRel.java
 ##########
 @@ -488,22 +499,38 @@ private Schema buildNullSchema(Schema schema) {
     return kvs.setCoder(KvCoder.of(coder.getKeyCoder(), valueCoder));
   }
 
-  private List<Pair<Integer, Integer>> extractJoinColumns(int 
leftRowColumnCount) {
+  private static Field getFieldBasedOnRexNode(
+      Schema schema, RexNode rexNode, int leftRowColumnCount) {
+    if (rexNode instanceof RexInputRef) {
+      return schema.getField(((RexInputRef) rexNode).getIndex() - 
leftRowColumnCount);
+    } else if (rexNode instanceof RexFieldAccess) {
+      // need to extract field of Struct/Row.
+      RexFieldAccess fieldAccess = (RexFieldAccess) rexNode;
+      RexInputRef inputRef = (RexInputRef) fieldAccess.getReferenceExpr();
 
 Review comment:
   You are absolutely right. `row.row.row.field` should have `ref.fc.fc`. 
Improved to support longer field access chain.
 
----------------------------------------------------------------
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]


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

    Worklog Id:     (was: 228854)
    Time Spent: 2h  (was: 1h 50m)

> JOIN condition should accept field access
> -----------------------------------------
>
>                 Key: BEAM-7070
>                 URL: https://issues.apache.org/jira/browse/BEAM-7070
>             Project: Beam
>          Issue Type: Improvement
>          Components: dsl-sql
>            Reporter: Rui Wang
>            Assignee: Rui Wang
>            Priority: Major
>          Time Spent: 2h
>  Remaining Estimate: 0h
>




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

Reply via email to