class PartitionSpecParser {

  public static PartitionSpec fromJson(Schema schema, JsonNode json) {
    Preconditions.checkArgument(json.isObject(), "Cannot parse spec from non-object: %s", json);
    int specId = JsonUtil.getInt(SPEC_ID, json);
    PartitionSpec.Builder builder = PartitionSpec.builderFor(schema).withSpecId(specId);
    buildFromJsonFields(builder, json.get(FIELDS));
    return builder.build();
  }

  private  PartitionSpecParser();

}