private void initialize(HiveConf hiveConf) {
    resolvers = new ArrayList<PhysicalPlanResolver>();
    if (hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_CONVERT_JOIN)) {
      resolvers.add(new CommonJoinResolver());

      // The joins have been automatically converted to map-joins.
      // However, if the joins were converted to sort-merge joins automatically,
      // they should also be tried as map-joins.
      if (hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_AUTO_SORTMERGE_JOIN_TOMAPJOIN)) {
        resolvers.add(new SortMergeJoinResolver());
      }
    }
    if (hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SKEW_JOIN)) {
      resolvers.add(new SkewJoinResolver());
    }

    resolvers.add(new MapJoinResolver());
    if (hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_METADATA_ONLY_QUERIES)) {
      resolvers.add(new MetadataOnlyOptimizer());
    }
    if (hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_NULL_SCAN_OPTIMIZE)) {
      resolvers.add(new NullScanOptimizer());
    }
    if (hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SAMPLING_FOR_ORDERBY)) {
      resolvers.add(new SamplingOptimizer());
    }

    // Physical optimizers which follow this need to be careful not to invalidate the inferences
    // made by this optimizer. Only optimizers which depend on the results of this one should
    // follow it.
    if (hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_INFER_BUCKET_SORT)) {
      resolvers.add(new BucketingSortingInferenceOptimizer());
    }

    if (hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_CHECK_CROSS_PRODUCT)) {
      resolvers.add(new CrossProductHandler());
    }

    // Vectorization should be the last optimization, because it doesn't modify the plan
    // or any operators. It makes a very low level transformation to the expressions to
    // run in the vectorized mode.
    if (hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_VECTORIZATION_ENABLED) ||
        HiveConf.getVar(hiveConf,
            HiveConf.ConfVars.HIVE_TEST_VECTORIZATION_ENABLED_OVERRIDE).equalsIgnoreCase(
                "enable")) {
      resolvers.add(new Vectorizer());
    }
    if (!"none".equalsIgnoreCase(hiveConf.getVar(HiveConf.ConfVars.HIVE_STAGE_ID_REARRANGE))) {
      resolvers.add(new StageIDsRearranger());
    }

    if (pctx.getContext().getExplainAnalyze() != null) {
      resolvers.add(new AnnotateRunTimeStatsOptimizer());
    }
  }
create the list of physical plan resolvers.

@param hiveConf
ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/PhysicalOptimizer.java