private static List<Boolean> decideSkewedValueDirSelection(Partition part, ExprNodeDesc pruner,
      List<Path> selectedPaths, List<List<String>> collections,
      List<List<String>> uniqSkewedValues) throws SemanticException {
    // For each entry in dynamic-multi-dimension collection.
    List<String> skewedCols = part.getSkewedColNames(); // Retrieve skewed column.
    Map<List<String>, String> mappings = part.getSkewedColValueLocationMaps(); // Retrieve skewed
                                                                               // map.
    assert ListBucketingPrunerUtils.isListBucketingPart(part) : part.getName()
        + " skewed metadata is corrupted. No skewed column and/or location mappings information.";
    List<List<String>> skewedValues = part.getSkewedColValues();
    List<Boolean> nonSkewedValueMatchResult = new ArrayList<Boolean>();
    for (List<String> cell : collections) {
      // Walk through the tree to decide value.
      // Example: skewed column: C1, C2 ;
      // index: (1,a) ;
      // expression tree: ((c1=1) and (c2=a)) or ((c1=3) or (c2=b))
      Boolean matchResult = ListBucketingPrunerUtils.evaluateExprOnCell(skewedCols, cell, pruner,
          uniqSkewedValues);
      // Handle skewed value.
      if (skewedValues.contains(cell)) { // if it is skewed value
        if ((matchResult == null) || matchResult) { // add directory to path unless value is false
          /* It's valid case if a partition: */
          /* 1. is defined with skewed columns and skewed values in metadata */
          /* 2. doesn't have all skewed values within its data */
          if (mappings.get(cell) != null) {
            selectedPaths.add(new Path(mappings.get(cell)));
          }
        }
      } else {
        // Non-skewed value, add it to list for later handle on default directory.
        nonSkewedValueMatchResult.add(matchResult);
      }
    }
    return nonSkewedValueMatchResult;
  }
Walk through every entry in complete collection
1. calculate if it matches expression tree
2. decide if select skewed value directory
3. store match result for non-skewed value for later handle on default directory
C1\C2 | a | b | c |Other
1 | (1,a) | X | (1,c) |X
2 | X |(2,b) | X |X
other | X | X | X |X
Final result
Complete dynamic-multi-dimension collection
(0,0) (1,a) * -> T
(0,1) (1,b) -> T
(0,2) (1,c) *-> F
(0,3) (1,other)-> F
(1,0) (2,a)-> F
(1,1) (2,b) * -> T
(1,2) (2,c)-> F
(1,3) (2,other)-> F
(2,0) (other,a) -> T
(2,1) (other,b) -> T
(2,2) (other,c) -> T
(2,3) (other,other) -> T

* is skewed value entry

1. directory for (1,a) is chosen because it 's skewed value and match returns true
2. directory for (2,b) is chosen because it 's skewed value and match returns true

@param part
@param pruner
@param selectedPaths
@param collections
@param uniqSkewedValues
@return
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/optimizer/listbucketingpruner/ListBucketingPruner.java