private void pushProjectionsAndFilters(final JobConf jobConf,
      final String splitPath,
      final String splitPathWithNoSchema) {

    if (mapWork == null) {
      return;
    } else if (mapWork.getPathToAliases() == null) {
      return;
    }

    final Set<String> aliases = new HashSet<String>();
    try {
      List<String> a = HiveFileFormatUtils.getFromPathRecursively(
          mapWork.getPathToAliases(), new Path(splitPath), null, false, true);
      if (a != null) {
        aliases.addAll(a);
      }
      if (a == null || a.isEmpty()) {
        // TODO: not having aliases for path usually means some bug. Should it give up?
        LOG.warn("Couldn't find aliases for " + splitPath);
      }
    } catch (IllegalArgumentException | IOException e) {
      throw new RuntimeException(e);
    }
    // Collect the needed columns from all the aliases and create ORed filter
    // expression for the table.
    boolean allColumnsNeeded = false;
    boolean noFilters = false;
    Set<Integer> neededColumnIDs = new HashSet<Integer>();
    // To support nested column pruning, we need to track the path from the top to the nested
    // fields
    Set<String> neededNestedColumnPaths = new HashSet<String>();
    List<ExprNodeGenericFuncDesc> filterExprs = new ArrayList<ExprNodeGenericFuncDesc>();
    RowSchema rowSchema = null;

    for(String alias : aliases) {
      final Operator<? extends Serializable> op =
          mapWork.getAliasToWork().get(alias);
      if (op != null && op instanceof TableScanOperator) {
        final TableScanOperator ts = (TableScanOperator) op;

        if (ts.getNeededColumnIDs() == null) {
          allColumnsNeeded = true;
        } else {
          neededColumnIDs.addAll(ts.getNeededColumnIDs());
          if (ts.getNeededNestedColumnPaths() != null) {
            neededNestedColumnPaths.addAll(ts.getNeededNestedColumnPaths());
          }
        }

        rowSchema = ts.getSchema();
        ExprNodeGenericFuncDesc filterExpr =
            ts.getConf() == null ? null : ts.getConf().getFilterExpr();
        noFilters = filterExpr == null; // No filter if any TS has no filter expression
        filterExprs.add(filterExpr);
      }
    }

    ExprNodeGenericFuncDesc tableFilterExpr = null;
    if (!noFilters) {
      try {
        for (ExprNodeGenericFuncDesc filterExpr : filterExprs) {
          if (tableFilterExpr == null ) {
            tableFilterExpr = filterExpr;
          } else {
            tableFilterExpr = ExprNodeGenericFuncDesc.newInstance(new GenericUDFOPOr(),
                Arrays.<ExprNodeDesc>asList(tableFilterExpr, filterExpr));
          }
        }
      } catch(UDFArgumentException ex) {
        LOG.debug("Turn off filtering due to " + ex);
        tableFilterExpr = null;
      }
    }

    // push down projections
    if (!allColumnsNeeded) {
      if (!neededColumnIDs.isEmpty()) {
        ColumnProjectionUtils.appendReadColumns(jobConf, new ArrayList<Integer>(neededColumnIDs));
        ColumnProjectionUtils.appendNestedColumnPaths(jobConf,
          new ArrayList<String>(neededNestedColumnPaths));
      }
    } else {
      ColumnProjectionUtils.setReadAllColumns(jobConf);
    }

    pushFilters(jobConf, rowSchema, tableFilterExpr);
  }
Sets the mapWork variable based on the current JobConf in order to get all partitions.

@param job
ql/src/java/org/apache/hadoop/hive/ql/io/parquet/ProjectionPusher.java