Github user HeartSaVioR commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1656#discussion_r78004559
  
    --- Diff: storm-core/src/jvm/org/apache/storm/trident/TridentTopology.java 
---
    @@ -277,6 +277,35 @@ public Stream join(List<Stream> streams, List<Fields> 
joinFields, Fields outFiel
                   outFields);
         }
     
    +    public Stream joinSQL(Stream s1, Fields joinFields1, Stream s2, Fields 
joinFields2, Fields outFields) {
    --- End diff --
    
    Current `join` emits the tuples reordering via list of join fields -> list 
of non-joined fields from all streams.
    http://storm.apache.org/releases/1.0.2/Trident-API-Overview.html
    
    Preserving parameters mean the tuples emitted from the join preserve the 
fields order. It is needed for creating result of SQL join. This is in fact 
more than reordering fields, meaning separating joined fields from streams.
    
    Let's assume that stream SA has 'a', 'b', 'c', and stream SB has 'c', 'd', 
'e'. If we join two streams with SA.c = SB.c with left outer join, 'd' and 'e' 
will be null if there's no matched SB row for SA row R1. In this case SB.c 
should be null, but we can't determine this from current implementation of 
`join`, because current `join` only returns SA.c as joined fields.
    We can't even determine SB is not matched via checking non-joined fields as 
null, since 'd', 'e' could be null even though there's matched SB row.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to