/** * Parquet {@link Repetition} for this {@link JsonSchema}. * @return */ public Repetition optionalOrRequired() { return this.isNullable() ? OPTIONAL : REQUIRED; }
@Override Object convertField(JsonElement value) { if (symbols.contains(value.getAsString()) || this.jsonSchema.isNullable()) { return this.elementConverter.convert(value); } throw new RuntimeException("Symbol " + value.getAsString() + " does not belong to set " + symbols.toString()); }
/** * Convert value to a parquet type and perform null check. * @param value * @return Parquet safe type */ public Object convert(JsonElement value) { if (value.isJsonNull()) { if (this.jsonSchema.isNullable()) { return null; } throw new RuntimeException( "Field: " + this.jsonSchema.getColumnName() + " is not nullable and contains a null value"); } return convertField(value); }
/** * Parquet {@link Repetition} for this {@link JsonSchema}. * @return */ public Repetition optionalOrRequired() { return this.isNullable() ? OPTIONAL : REQUIRED; }
@Override Object convertField(JsonElement value) { if (symbols.contains(value.getAsString()) || this.jsonSchema.isNullable()) { return this.elementConverter.convert(value); } throw new RuntimeException("Symbol " + value.getAsString() + " does not belong to set " + symbols.toString()); }
/** * Convert value to a parquet type and perform null check. * @param value * @return Parquet safe type */ public Object convert(JsonElement value) { if (value.isJsonNull()) { if (this.jsonSchema.isNullable()) { return null; } throw new RuntimeException( "Field: " + this.jsonSchema.getColumnName() + " is not nullable and contains a null value"); } return convertField(value); }