List<OperatorBucketingVersionInfo> getBucketingVersions() {
      List<OperatorBucketingVersionInfo> ret = new ArrayList<>();
      for (Operator<?> operator : members) {
        if (operator instanceof TableScanOperator) {
          TableScanOperator tso = (TableScanOperator) operator;
          int bucketingVersion = tso.getConf().getTableMetadata().getBucketingVersion();
          int numBuckets = tso.getConf().getNumBuckets();
          if (numBuckets > 1) {
            ret.add(new OperatorBucketingVersionInfo(operator, InfoType.MANDATORY, bucketingVersion));
          } else {
            LOG.info("not considering bucketingVersion for: {} because it has {}<2 buckets ", tso, numBuckets);
          }
        }
        if (operator instanceof FileSinkOperator) {
          FileSinkOperator fso = (FileSinkOperator) operator;
          int bucketingVersion = fso.getConf().getTableInfo().getBucketingVersion();
          // for FileSinkOperator-s keeping the RS side in sync w.r.t to the bucketing version is beneficial
          // but since they are internally compute the bucket number with the correct algo they don't rely on it.
          ret.add(new OperatorBucketingVersionInfo(operator, InfoType.OPTIONAL, bucketingVersion));
        }
      }
      return ret;
    }
A Group of operators which must have the same bucketing version.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/BucketVersionPopulator.java