private int[] toArray(Set<Integer> values) {
      int index = 0;
      int[] result = new int[values.size()];
      for (int value : values) {
        result[index++] = value;
      }
      return result;
    }
creates synthetic predicates that represent "IN (keylist other table)"
ql/src/java/org/apache/hadoop/hive/ql/ppd/SyntheticJoinPredicate.java