private static Long computeCumulativeCardinality(Operator<? extends OperatorDesc> op) {
    long cumulativeCardinality = 0L;
    if (op instanceof CommonJoinOperator) {
      // Choose max
      for (Operator<? extends OperatorDesc> inputOp : op.getParentOperators()) {
        Long inputCardinality = computeCumulativeCardinality(inputOp);
        if (inputCardinality == null) {
          return null;
        }
        if (inputCardinality > cumulativeCardinality) {
          cumulativeCardinality = inputCardinality;
        }
      }
    } else {
      // Choose cumulative
      for (Operator<? extends OperatorDesc> inputOp : op.getParentOperators()) {
        Long inputCardinality = computeCumulativeCardinality(inputOp);
        if (inputCardinality == null) {
          return null;
        }
        cumulativeCardinality += inputCardinality;
      }
    }
    Statistics currInputStat = op.getStatistics();
    if (currInputStat == null) {
      LOG.warn("Couldn't get statistics from: " + op);
      return null;
    }
    cumulativeCardinality += currInputStat.getNumRows();
    return cumulativeCardinality;
  }
Obtain big table position for join.

@param joinOp join operator
@param context optimization context
@param buckets bucket count for Bucket Map Join conversion consideration or reduce count
for Dynamic Hash Join conversion consideration
@param skipJoinTypeChecks whether to skip join type checking
@param maxSize size threshold for Map Join conversion
@param checkMapJoinThresholds whether to check thresholds to convert to Map Join
@return returns big table position or -1 if it cannot be determined
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConvertJoinMapJoin.java