Builds a {@link PartitionStrategy} from a list of Hive partition fields.

@param fields a List of FieldSchemas
@return a PartitionStrategy for the Hive partitions
489968
@VisibleForTesting
  static PartitionStrategy fromPartitionColumns(List<FieldSchema> fields) {
    PartitionStrategy.Builder builder = new PartitionStrategy.Builder();
    for (FieldSchema hiveSchema : fields) {
      TypeInfo type = HiveSchemaConverter.parseTypeInfo(hiveSchema.getType());
      // any types not in the map will be treated as Strings
      builder.provided(hiveSchema.getName(),
          PROVIDED_TYPES.get(type.getTypeName()));
    }
    return builder.build();
  }
152137
public void setPartitionValues(java.util.Collection<String> partitionValues) {
        if (partitionValues == null) {
            this.partitionValues = null;
            return;
        }

        this.partitionValues = new java.util.ArrayList<String>(partitionValues);
    }
635568
private static String join(List<Field> fields, String sep) {
	    return join(fields, sep, null);
    }
816130
public String buildWhere(Set<Map.Entry<String, Object>> fields) {
		StringBuilder selection = new StringBuilder();
		for (Map.Entry<String, Object> field : fields) {
			if (selection.length() > 0) {
				selection.append(" AND ");
			}
			selection.append(buildWhere(field.getKey(), field.getValue()));
		}
		return selection.toString();
	}
1123469
public HCatInputFormatBase<T> getFields(String... fields) throws IOException {

		// build output schema
		ArrayList<HCatFieldSchema> fieldSchemas = new ArrayList<HCatFieldSchema>(fields.length);
		for (String field : fields) {
			fieldSchemas.add(this.outputSchema.get(field));
		}
		this.outputSchema = new HCatSchema(fieldSchemas);

		// update output schema configuration
		configuration.set("mapreduce.lib.hcat.output.schema", HCatUtil.serialize(outputSchema));

		return this;
	}
1368388
private static Set<Field> findAllFieldsUsingStrategy(FieldMatcherStrategy strategy, Object object,
                                                         boolean checkHierarchy, Class<?> startClass) {
        assertObjectInGetInternalStateIsNotNull(object);
        final Set<Field> foundFields = new LinkedHashSet<Field>();
        while (startClass != null) {
            final Field[] declaredFields = startClass.getDeclaredFields();
            for (Field field : declaredFields) {
                if (strategy.matches(field) && hasFieldProperModifier(object, field)) {
                    // TODO replace by the class 
                    try {
                        field.setAccessible(true);
                        foundFields.add(field);
                    } catch (Exception ignored) {
                        // the InaccessibleObjectException is thrown in Java 9 in case
                        // if a field is private and a module is not open
                    }
                }
            }
            if (!checkHierarchy) {
                break;
            }
            startClass = startClass.getSuperclass();
        }

        return Collections.unmodifiableSet(foundFields);
    }
907716
public CMAEntry setFields(LinkedHashMap<String, LinkedHashMap<String, Object>> fields) {
    this.fields = fields;
    return this;
  }
262505
PartitionStrategy getSubpartitionStrategy(int startIndex) {
    if (startIndex == 0) {
      return this;
    }
    if (startIndex >= fieldPartitioners.size()) {
      return null;
    }
    return new PartitionStrategy(fieldPartitioners.subList(startIndex,
        fieldPartitioners.size()));
  }
1309345
public static Builder pullAll(String field, List<?> values) {
        return new Builder().pullAll(field, values);
    }
570822
public static List<Partition> getPartitions(IMetaStoreClient client, Table table, Optional<String> filter)
      throws IOException {
    return getPartitions(client, table, filter, Optional.<HivePartitionExtendedFilter>absent());
  }
223224
public Iterable<BoxMetadataCascadePolicy.Info> getMetadataCascadePolicies(String... fields) {
        Iterable<BoxMetadataCascadePolicy.Info> cascadePoliciesInfo =
                BoxMetadataCascadePolicy.getAll(this.getAPI(), this.getID(), fields);

        return cascadePoliciesInfo;
    }
1298679
public static List<JBBPAbstractField> fieldsAsList(final JBBPAbstractField... fields) {
    final List<JBBPAbstractField> result = new ArrayList<>();
    Collections.addAll(result, fields);
    return result;
  }
1248838
public GelfMessage addFields(Map<String, String> fields) {

        if (fields == null) {
            throw new IllegalArgumentException("fields is null");
        }

        getAdditonalFields().putAll(fields);
        return this;
    }
1355839
public static <T> List<List<T>> partition(List<T> list, final int partitionSize) {
    List<List<T>> parts = new ArrayList<List<T>>();
    final int listSize = list.size();
    for (int i = 0; i < listSize; i += partitionSize) {
      parts.add(new ArrayList<T>(list.subList(i, Math.min(listSize, i + partitionSize))));
    }
    return parts;
  }
441662
public PartitionAwareDataWriterBuilder<S, D> forPartition(GenericRecord partition) {
    this.partition = Optional.fromNullable(partition);
    log.debug("For partition {}", this.partition);
    return this;
  }
565966
private RangeAggregationBuilder rangeBuilder(MethodField field) {

        // ignore alias param
        LinkedList<KVValue> params = field.getParams().stream().filter(kv -> !"alias".equals(kv.key)).collect(Collectors.toCollection(LinkedList::new));

        String fieldName = params.poll().toString();

        double[] ds = Util.KV2DoubleArr(params);

        RangeAggregationBuilder range = AggregationBuilders.range(field.getAlias()).field(fieldName);

        for (int i = 1; i < ds.length; i++) {
            range.addRange(ds[i - 1], ds[i]);
        }

        return range;
    }
216344
protected <T> List<List<T>> trivialPartition(List<T> objects, int minEntries, int maxEntries) {
    // build partitions
    final int size = objects.size();
    final int numberPartitions = (int) Math.ceil(((double) size) / maxEntries);
    List<List<T>> partitions = new ArrayList<>(numberPartitions);
    int start = 0;
    for(int pnum = 0; pnum < numberPartitions; pnum++) {
      int end = (int) ((pnum + 1.) * size / numberPartitions);
      if(pnum == numberPartitions - 1) {
        end = size;
      }
      assert ((end - start) >= minEntries && (end - start) <= maxEntries);
      partitions.add(objects.subList(start, end));
      start = end;
    }
    return partitions;
  }