Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-27507

ConvertJoinMapJoin#hasOuterJoin produce incorrect result

    XMLWordPrintableJSON

Details

    Description

      Now, the hasOuterJoin returns whether the last join condition is outer join. 
      If hast join condition is not outer join, it returns false reglardless there is outer join.

      private boolean hasOuterJoin(JoinOperator joinOp) throws SemanticException {
          boolean hasOuter = false;
          for (JoinCondDesc joinCondDesc : joinOp.getConf().getConds()) {
            switch (joinCondDesc.getType()) {
              case JoinDesc.INNER_JOIN:
              case JoinDesc.LEFT_SEMI_JOIN:
              case JoinDesc.UNIQUE_JOIN:
                hasOuter = false;
                break;
              case JoinDesc.FULL_OUTER_JOIN:
              case JoinDesc.LEFT_OUTER_JOIN:
              case JoinDesc.RIGHT_OUTER_JOIN:
                hasOuter = true;
                break;
              default:
                throw new SemanticException("Unknown join type " + joinCondDesc.getType());
            }
          }
          return hasOuter;
        } 

      There may be two solutions.
      1. Short circuit if found outer join and return true;
      2. Delete 'hasOuter = false;' if join type is not outer join and loop through all join conditions.

      Attachments

        Issue Links

          Activity

            People

              houzhizhen Zhizhen Hou
              houzhizhen Zhizhen Hou
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: