Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-33395

The join hint doesn't work when appears in subquery

    XMLWordPrintableJSON

Details

    Description

      See the existent test 'NestLoopJoinHintTest#testJoinHintWithJoinHintInCorrelateAndWithAgg', the test plan is 

      HashJoin(joinType=[LeftSemiJoin], where=[=(a1, EXPR$0)], select=[a1, b1], build=[right], tryDistinctBuildRow=[true])
      :- Exchange(distribution=[hash[a1]])
      :  +- TableSourceScan(table=[[default_catalog, default_database, T1]], fields=[a1, b1])
      +- Exchange(distribution=[hash[EXPR$0]])
         +- LocalHashAggregate(groupBy=[EXPR$0], select=[EXPR$0])
            +- Calc(select=[EXPR$0])
               +- HashAggregate(isMerge=[true], groupBy=[a1], select=[a1, Final_COUNT(count$0) AS EXPR$0])
                  +- Exchange(distribution=[hash[a1]])
                     +- LocalHashAggregate(groupBy=[a1], select=[a1, Partial_COUNT(a2) AS count$0])
                        +- NestedLoopJoin(joinType=[InnerJoin], where=[=(a2, a1)], select=[a2, a1], build=[right])
                           :- TableSourceScan(table=[[default_catalog, default_database, T2, project=[a2], metadata=[]]], fields=[a2], hints=[[[ALIAS options:[T2]]]])
                           +- Exchange(distribution=[broadcast])
                              +- TableSourceScan(table=[[default_catalog, default_database, T1, project=[a1], metadata=[]]], fields=[a1], hints=[[[ALIAS options:[T1]]]]) 

      but the NestedLoopJoin should broadcase left side.

      Attachments

        Issue Links

          Activity

            People

              xuyangzhong xuyang
              xuyangzhong xuyang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: