static private boolean pruneBySequentialScan(Table tab, List<Partition> partitions,
      ExprNodeDesc prunerExpr, HiveConf conf) throws HiveException, MetaException {
    PerfLogger perfLogger = SessionState.getPerfLogger();
    perfLogger.perfLogBegin(CLASS_NAME, PerfLogger.PRUNE_LISTING);

    List<String> partNames = Hive.get().getPartitionNames(tab, (short) -1);

    String defaultPartitionName = conf.getVar(HiveConf.ConfVars.DEFAULT_PARTITION_NAME);
    List<String> partCols = tab.getPartColNames();
    List<PrimitiveTypeInfo> partColTypeInfos = extractPartColTypes(tab);

    boolean hasUnknownPartitions = prunePartitionNames(
        partCols, partColTypeInfos, prunerExpr, defaultPartitionName, partNames);
    perfLogger.perfLogEnd(CLASS_NAME, PerfLogger.PRUNE_LISTING);

    perfLogger.perfLogBegin(CLASS_NAME, PerfLogger.PARTITION_RETRIEVING);
    if (!partNames.isEmpty()) {
      partitions.addAll(Hive.get().getPartitionsByNames(tab, partNames));
    }
    perfLogger.perfLogEnd(CLASS_NAME, PerfLogger.PARTITION_RETRIEVING);
    return hasUnknownPartitions;
  }
Pruning partition by getting the partition names first and pruning using Hive expression
evaluator on client.
@param tab the table containing the partitions.
@param partitions the resulting partitions.
@param prunerExpr the SQL predicate that involves partition columns.
@param conf Hive Configuration object, can not be NULL.
@return true iff the partition pruning expression contains non-partition columns.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/ppr/PartitionPruner.java