private static boolean canTableUseStats(Operator op, StringBuilder sb) {
    Operator ancestor = OperatorUtils.findSingleOperatorUpstream(op, TableScanOperator.class);
    if (ancestor != null) {
      TableScanOperator ts = (TableScanOperator) ancestor;
      Boolean canUseStats = StatsUtils.checkCanProvideStats(new Table(ts.getConf().getTableMetadata().getTTable()));
      if (!canUseStats) {
        sb.append(ts.getConf().getTableMetadata().getFullyQualifiedName());
        return false;
      }
    }
    return true;
  }
Estimate the number of buckets in the join, using the parent operators' OpTraits and/or
parent operators' number of reducers
@param joinOp
@param useOpTraits  Whether OpTraits should be used for the estimate.
@return
ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConvertJoinMapJoin.java