5 Replies Latest reply: Aug 14, 2015 10:11 AM by Srikanth P RSS

    Left Join followed by Outer Join (and vice-versa)

    Peter Karimeddini

      I am trying to blend data from 2 sources, and which source takes precedence depends on the status. It seems like whichever join is 2nd does actually happen, and I do not understand why. Is this a bug or a subtle intended behavior?

       

      This is a bare-bones example of my script:

       

      foo:
      LOAD *
      INLINE [key,status_foo,val
      1,b,qwerty
      2,b,asdf
      ]
      ;

      bar:
      LOAD *
      INLINE [key,status_bar
      1,b
      2,a
      3,b
      4,a
      ]
      ;

      foobar_q:
      OUTER JOIN(foo)
      LOAD * RESIDENT bar WHERE status_bar = 'a';

      foobar_b:
      LEFT JOIN(foo)
      LOAD * RESIDENT bar WHERE status_bar = 'b';

      DROP TABLE bar;

       

      This is the output I expect:

      keystatus_foostatus_barval
      1bbqwerty
      2bqasdf
      4-q-