Class CommonExecLookupJoin

  • All Implemented Interfaces:
    ExecNode<RowData>, ExecNodeTranslator<RowData>, FusionCodegenExecNode
    Direct Known Subclasses:
    BatchExecLookupJoin, StreamExecLookupJoin

    public abstract class CommonExecLookupJoin
    extends ExecNodeBase<RowData>
    Base ExecNode for temporal table join which shares most methods.

    For a lookup join query:

     SELECT T.id, T.content, D.age
     FROM T JOIN userTable FOR SYSTEM_TIME AS OF T.proctime AS D
     ON T.content = concat(D.name, '!') AND D.age = 11 AND T.id = D.id
     WHERE D.name LIKE 'Jack%'
     

    The LookupJoin physical node encapsulates the following RelNode tree:

          Join (l.name = r.name)
        /     \
     RelNode  Calc (concat(name, "!") as name, name LIKE 'Jack%')
               |
            DimTable (lookup-keys: age=11, id=l.id)
         (age, id, name)
     
    • lookupKeys: [$0=11, $1=l.id] ($0 and $1 is the indexes of age and id in dim table)
    • calcOnTemporalTable: calc on temporal table rows before join
    • joinCondition: join condition on temporal table rows after calc

    The workflow of lookup join:

    1) lookup records dimension table using the lookup-keys
    2) project & filter on the lookup-ed records
    3) join left input record and lookup-ed records
    4) only outputs the rows which match to the condition