Package ai.rapids.cudf
Class JSONOptions.Builder
- Enclosing class:
- JSONOptions
public static final class JSONOptions.Builder
extends ColumnFilterOptions.Builder<JSONOptions.Builder>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
includeColumn
(String... names) Include one or more specific columns.includeColumn
(Collection<String> names) Include one or more specific columns.withCudfPruneSchema
(boolean prune) withDayFirst
(boolean dayFirst) Whether to parse dates as DD/MM versus MM/DDwithExperimental
(boolean isAllowed) Should experimental features be enabled or notwithKeepQuotes
(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 linewithMixedTypesAsStrings
(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 notwithUnquotedControlChars
(boolean isAllowed) Should unquoted control chars be allowed in strings.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
withCudfPruneSchema
-
withLineDelimiter
-
withStrictValidation
Should json validation be strict or not -
withExperimental
Should experimental features be enabled or not -
withLeadingZeros
Should leading zeros on numbers be allowed or not. Strict validation must be enabled for this to have any effect. -
withNonNumericNumbers
Should non-numeric numbers be allowed or not. Strict validation must be enabled for this to have any effect. -
withUnquotedControlChars
Should unquoted control chars be allowed in strings. Strict validation must be enabled for this to have any effect. -
withDayFirst
Whether to parse dates as DD/MM versus MM/DD- Parameters:
dayFirst
- true: DD/MM, false, MM/DD- Returns:
- builder for chaining
-
withLines
Whether to read the file as a json object per line- Parameters:
perLine
- true: per line, false: multi-line- Returns:
- builder for chaining
-
withRecoverWithNull
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
-
withNormalizeSingleQuotes
Should the single quotes be normalized. -
withNormalizeWhitespace
Should the unquoted whitespace be removed. -
withMixedTypesAsStrings
Specify how to handle columns that contain mixed types.- Parameters:
mixedTypesAsStrings
- true: return unparsed JSON, false: throw exception- Returns:
- builder for chaining
-
withKeepQuotes
Set whether the reader should keep quotes of string values.- Parameters:
keepQuotes
- true to keep them, else false.- Returns:
- this for chaining.
-
includeColumn
Description copied from class:ColumnFilterOptions.Builder
Include one or more specific columns. Any column not included will not be read.- Overrides:
includeColumn
in classColumnFilterOptions.Builder<JSONOptions.Builder>
- Parameters:
names
- the name of the column, or more than one if you want.
-
includeColumn
Description copied from class:ColumnFilterOptions.Builder
Include one or more specific columns. Any column not included will not be read.- Overrides:
includeColumn
in classColumnFilterOptions.Builder<JSONOptions.Builder>
- Parameters:
names
- the name of the column, or more than one if you want.
-
build
-