JSONOptions#

public final class JSONOptions extends ColumnFilterOptions#

Options for reading in JSON encoded data.

Field Summary

Method Summary

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()#

Static Methods

public static Builder builder()#
public static final class Builder extends ColumnFilterOptions.Builder<JSONOptions.Builder>#

Method Summary

build()

includeColumn(Collection<String> names)

includeColumn(String... names)

withCudfPruneSchema(boolean prune)

withDayFirst(boolean dayFirst)

Whether to parse dates as DD/MM versus MM/DD.

withExperimental(boolean isAllowed)

Should experimental features be enabled or not.

withKeepQuotes(boolean keepQuotes)

Set whether the reader should keep quotes of string values.

withLeadingZeros(boolean isAllowed)

Should leading zeros on numbers be allowed or not.

withLineDelimiter(char delimiter)

withLines(boolean perLine)

Whether to read the file as a json object per line.

withMixedTypesAsStrings(boolean mixedTypesAsStrings)

Specify how to handle columns that contain mixed types.

withNonNumericNumbers(boolean isAllowed)

Should non-numeric numbers be allowed or not.

withNormalizeSingleQuotes(boolean normalizeSingleQuotes)

Should the single quotes be normalized.

withNormalizeWhitespace(boolean normalizeWhitespace)

Should the unquoted whitespace be removed.

withRecoverWithNull(boolean recoverWithNull)

Specify how to handle invalid lines when parsing json.

withStrictValidation(boolean isAllowed)

Should json validation be strict or not.

withUnquotedControlChars(boolean isAllowed)

Should unquoted control chars be allowed in strings.

Methods

public Builder withCudfPruneSchema(boolean prune)#
public Builder withLineDelimiter(char delimiter)#
public Builder withStrictValidation(boolean isAllowed)#

Should json validation be strict or not.

public Builder withExperimental(boolean isAllowed)#

Should experimental features be enabled or not.

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(String... names)#
public Builder includeColumn(Collection<String> names)#
public JSONOptions build()#