JSONOptions#
- public final class JSONOptions extends ColumnFilterOptions#
Options for reading in JSON encoded data.
Field Summary
Method Summary
Return the value of the recoverWithNull option.
Static Fields
- public static JSONOptions DEFAULT#
Methods
- public boolean shouldCudfPruneSchema()#
- public byte getLineDelimiter()#
- public boolean isDayFirst()#
- public boolean isLines()#
- public boolean isRecoverWithNull()#
Return the value of the recoverWithNull option.
- public boolean isNormalizeSingleQuotes()#
- public boolean isNormalizeWhitespace()#
- public boolean isMixedTypesAsStrings()#
- public boolean keepStringQuotes()#
- public boolean strictValidation()#
- public boolean leadingZerosAllowed()#
- public boolean nonNumericNumbersAllowed()#
- public boolean unquotedControlChars()#
- public boolean experimental()#
- public static final class Builder extends ColumnFilterOptions.Builder<JSONOptions.Builder>#
Method Summary
Whether to parse dates as DD/MM versus MM/DD.
Should experimental features be enabled or not.
Set whether the reader should keep quotes of string values.
Should leading zeros on numbers be allowed or not.
Whether to read the file as a json object per line.
Specify how to handle columns that contain mixed types.
Should non-numeric numbers be allowed or not.
Should the single quotes be normalized.
Should the unquoted whitespace be removed.
Specify how to handle invalid lines when parsing json.
Should json validation be strict or not.
Should unquoted control chars be allowed in strings.
Methods
- public Builder withLeadingZeros(boolean isAllowed)#
Should leading zeros on numbers be allowed or not.
Strict validation must be enabled for this to have any effect.
- public Builder withNonNumericNumbers(boolean isAllowed)#
Should non-numeric numbers be allowed or not.
Strict validation must be enabled for this to have any effect.
- public Builder withUnquotedControlChars(boolean isAllowed)#
Should unquoted control chars be allowed in strings.
Strict validation must be enabled for this to have any effect.
- public Builder withDayFirst(boolean dayFirst)#
Whether to parse dates as DD/MM versus MM/DD.
- Parameters:
dayFirst – true: DD/MM, false, MM/DD
- Returns:
builder for chaining
- public Builder withLines(boolean perLine)#
Whether to read the file as a json object per line.
- Parameters:
perLine – true: per line, false: multi-line
- Returns:
builder for chaining
- public Builder withRecoverWithNull(boolean recoverWithNull)#
Specify how to handle invalid lines when parsing json.
Setting recoverWithNull to true will cause null values to be returned for invalid lines. Setting recoverWithNull to false will cause the parsing to fail with an exception.
- Parameters:
recoverWithNull – true: return nulls, false: throw exception
- Returns:
builder for chaining
- public Builder withNormalizeSingleQuotes(
- boolean normalizeSingleQuotes
Should the single quotes be normalized.
- public Builder withNormalizeWhitespace(boolean normalizeWhitespace)#
Should the unquoted whitespace be removed.
- public Builder withMixedTypesAsStrings(boolean mixedTypesAsStrings)#
Specify how to handle columns that contain mixed types.
- Parameters:
mixedTypesAsStrings – true: return unparsed JSON, false: throw exception
- Returns:
builder for chaining
- public Builder withKeepQuotes(boolean keepQuotes)#
Set whether the reader should keep quotes of string values.
- Parameters:
keepQuotes – true to keep them, else false.
- Returns:
this for chaining.
- public Builder includeColumn(Collection<String> names)#
- public JSONOptions build()#