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

ConvertJoinMapJoin#hasOuterJoin produce incorrect result

Log workAgile BoardRank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            houzhizhen Zhizhen Hou Assign to me
            houzhizhen Zhizhen Hou

            Dates

              Created:
              Updated:

              Slack

                Issue deployment