[ 
https://issues.apache.org/jira/browse/HIVE-4106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13593767#comment-13593767
 ] 

Namit Jain commented on HIVE-4106:
----------------------------------

  // check if the join operator encountered is a candidate for being converted
  // to a sort-merge join
  private NodeProcessor getCheckCandidateJoin() {
    return new NodeProcessor() {
      @Override
      public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx 
procCtx,
        Object... nodeOutputs) throws SemanticException {
        SortBucketJoinProcCtx smbJoinContext = (SortBucketJoinProcCtx)procCtx;
        JoinOperator joinOperator = (JoinOperator)nd;
        int size = stack.size();
        if (!(stack.get(size-1) instanceof JoinOperator) ||
            !(stack.get(size-2) instanceof ReduceSinkOperator)) {
          smbJoinContext.getRejectedJoinOps().add(joinOperator);
          return null;
        }

        // If any operator in the stack does not support a auto-conversion, 
this join should
        // not be converted.
        for (int pos = size -3; pos >= 0; pos--) {
          Operator<? extends OperatorDesc> op = (Operator<? extends 
OperatorDesc>)stack.get(pos);
          if (!op.supportAutomaticSortMergeJoin()) {
            smbJoinContext.getRejectedJoinOps().add(joinOperator);
            return null;
          }
        }

        return null;
      }
    };
  }


It should be done above - file SortedMergeBucketMapJoinOptimizer.java.
Can you try your testcase, and see if it being added to rejectJoinOps ?
                
> SMB joins fail in multi-way joins
> ---------------------------------
>
>                 Key: HIVE-4106
>                 URL: https://issues.apache.org/jira/browse/HIVE-4106
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Processor
>    Affects Versions: 0.11.0
>            Reporter: Vikram Dixit K
>            Assignee: Vikram Dixit K
>         Attachments: HIVE-4106.patch
>
>
> I see array out of bounds exception in case of multi way smb joins. This is 
> related to changes that went in as part of HIVE-3403. This issue has been 
> discussed in HIVE-3891.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to