Public Member Functions | List of all members
cudf::io::json_reader_options_builder Class Reference

Builds settings to use for read_json(). More...

#include <json.hpp>

Public Member Functions

 json_reader_options_builder ()=default
 Default constructor. More...
 
 json_reader_options_builder (source_info src)
 Constructor from source info. More...
 
json_reader_options_builderdtypes (std::vector< data_type > types)
 Set data types for columns to be read. More...
 
json_reader_options_builderdtypes (std::map< std::string, data_type > types)
 Set data types for columns to be read. More...
 
json_reader_options_builderdtypes (std::map< std::string, schema_element > types)
 Set data types for columns to be read. More...
 
json_reader_options_builderdtypes (schema_element types)
 Set data types for columns to be read. More...
 
json_reader_options_buildercompression (compression_type comp_type)
 Set the compression type. More...
 
json_reader_options_builderbyte_range_offset (size_type offset)
 Set number of bytes to skip from source start. More...
 
json_reader_options_builderbyte_range_size (size_type size)
 Set number of bytes to read. More...
 
json_reader_options_builderdelimiter (char delimiter)
 Set delimiter separating records in JSON lines. More...
 
json_reader_options_builderlines (bool val)
 Set whether to read the file as a json object per line. More...
 
json_reader_options_buildermixed_types_as_string (bool val)
 Set whether to parse mixed types as a string column. Also enables forcing to read a struct as string column using schema. More...
 
json_reader_options_builderprune_columns (bool val)
 Set whether to prune columns on read, selected based on the dtypes option. More...
 
json_reader_options_builderexperimental (bool val)
 Set whether to enable experimental features. More...
 
json_reader_options_builderdayfirst (bool val)
 Set whether to parse dates as DD/MM versus MM/DD. More...
 
json_reader_options_builderkeep_quotes (bool val)
 Set whether the reader should keep quotes of string values. More...
 
json_reader_options_buildernormalize_single_quotes (bool val)
 Set whether the reader should normalize single quotes around strings. More...
 
json_reader_options_buildernormalize_whitespace (bool val)
 Set whether the reader should normalize unquoted whitespace. More...
 
json_reader_options_builderrecovery_mode (json_recovery_mode_t val)
 Specifies the JSON reader's behavior on invalid JSON lines. More...
 
json_reader_options_builderstrict_validation (bool val)
 Set whether json validation should be strict or not. More...
 
json_reader_options_buildernumeric_leading_zeros (bool val)
 Set Whether leading zeros are allowed in numeric values. Strict validation must be enabled for this to have any effect. More...
 
json_reader_options_buildernonnumeric_numbers (bool val)
 Set whether specific unquoted number values are valid JSON. The values are NaN, +INF, -INF, +Infinity, Infinity, and -Infinity. Strict validation must be enabled for this to have any effect. More...
 
json_reader_options_builderunquoted_control_chars (bool val)
 Set whether chars >= 0 and < 32 are allowed in a quoted string without some form of escaping. Strict validation must be enabled for this to have any effect. More...
 
json_reader_options_builderna_values (std::vector< std::string > vals)
 Sets additional values to recognize as null values. More...
 
 operator json_reader_options && ()
 move json_reader_options member once it's built.
 
json_reader_options && build ()
 move json_reader_options member once it's built. More...
 

Detailed Description

Builds settings to use for read_json().

Definition at line 590 of file io/json.hpp.

Constructor & Destructor Documentation

◆ json_reader_options_builder() [1/2]

cudf::io::json_reader_options_builder::json_reader_options_builder ( )
explicitdefault

Default constructor.

This has been added since Cython requires a default constructor to create objects on stack.

◆ json_reader_options_builder() [2/2]

cudf::io::json_reader_options_builder::json_reader_options_builder ( source_info  src)
inlineexplicit

Constructor from source info.

Parameters
srcThe source information used to read avro file

Definition at line 606 of file io/json.hpp.

Member Function Documentation

◆ build()

json_reader_options&& cudf::io::json_reader_options_builder::build ( )
inline

move json_reader_options member once it's built.

This has been added since Cython does not support overloading of conversion operators.

Returns
Built json_reader_options object r-value reference

Definition at line 905 of file io/json.hpp.

◆ byte_range_offset()

json_reader_options_builder& cudf::io::json_reader_options_builder::byte_range_offset ( size_type  offset)
inline

Set number of bytes to skip from source start.

Parameters
offsetNumber of bytes of offset
Returns
this for chaining

Definition at line 674 of file io/json.hpp.

◆ byte_range_size()

json_reader_options_builder& cudf::io::json_reader_options_builder::byte_range_size ( size_type  size)
inline

Set number of bytes to read.

Parameters
sizeNumber of bytes to read
Returns
this for chaining

Definition at line 686 of file io/json.hpp.

◆ compression()

json_reader_options_builder& cudf::io::json_reader_options_builder::compression ( compression_type  comp_type)
inline

Set the compression type.

Parameters
comp_typeThe compression type used
Returns
this for chaining

Definition at line 662 of file io/json.hpp.

◆ dayfirst()

json_reader_options_builder& cudf::io::json_reader_options_builder::dayfirst ( bool  val)
inline

Set whether to parse dates as DD/MM versus MM/DD.

Parameters
valBoolean value to enable/disable day first parsing format
Returns
this for chaining

Definition at line 766 of file io/json.hpp.

◆ delimiter()

json_reader_options_builder& cudf::io::json_reader_options_builder::delimiter ( char  delimiter)
inline

Set delimiter separating records in JSON lines.

Parameters
delimiterDelimiter separating records in JSON lines
Returns
this for chaining

Definition at line 698 of file io/json.hpp.

◆ dtypes() [1/4]

json_reader_options_builder& cudf::io::json_reader_options_builder::dtypes ( schema_element  types)
inline

Set data types for columns to be read.

Parameters
typesStruct schema_element with Column name -> schema_element with map and order
Returns
this for chaining

Definition at line 650 of file io/json.hpp.

◆ dtypes() [2/4]

json_reader_options_builder& cudf::io::json_reader_options_builder::dtypes ( std::map< std::string, data_type types)
inline

Set data types for columns to be read.

Parameters
typesColumn name -> dtype map
Returns
this for chaining

Definition at line 626 of file io/json.hpp.

◆ dtypes() [3/4]

json_reader_options_builder& cudf::io::json_reader_options_builder::dtypes ( std::map< std::string, schema_element types)
inline

Set data types for columns to be read.

Parameters
typesColumn name -> schema_element map
Returns
this for chaining

Definition at line 638 of file io/json.hpp.

◆ dtypes() [4/4]

json_reader_options_builder& cudf::io::json_reader_options_builder::dtypes ( std::vector< data_type types)
inline

Set data types for columns to be read.

Parameters
typesVector of dtypes
Returns
this for chaining

Definition at line 614 of file io/json.hpp.

◆ experimental()

json_reader_options_builder& cudf::io::json_reader_options_builder::experimental ( bool  val)
inline

Set whether to enable experimental features.

When set to true, experimental features, such as the new column tree construction, utf-8 matching of field names will be enabled.

Parameters
valBoolean value to enable/disable experimental features
Returns
this for chaining

Definition at line 754 of file io/json.hpp.

◆ keep_quotes()

json_reader_options_builder& cudf::io::json_reader_options_builder::keep_quotes ( bool  val)
inline

Set whether the reader should keep quotes of string values.

Parameters
valBoolean value to indicate whether the reader should keep quotes of string values
Returns
this for chaining

Definition at line 779 of file io/json.hpp.

◆ lines()

json_reader_options_builder& cudf::io::json_reader_options_builder::lines ( bool  val)
inline

Set whether to read the file as a json object per line.

Parameters
valBoolean value to enable/disable the option to read each line as a json object
Returns
this for chaining

Definition at line 710 of file io/json.hpp.

◆ mixed_types_as_string()

json_reader_options_builder& cudf::io::json_reader_options_builder::mixed_types_as_string ( bool  val)
inline

Set whether to parse mixed types as a string column. Also enables forcing to read a struct as string column using schema.

Parameters
valBoolean value to enable/disable parsing mixed types as a string column
Returns
this for chaining

Definition at line 723 of file io/json.hpp.

◆ na_values()

json_reader_options_builder& cudf::io::json_reader_options_builder::na_values ( std::vector< std::string >  vals)
inline

Sets additional values to recognize as null values.

Parameters
valsVector of values to be considered to be null
Returns
this for chaining

Definition at line 887 of file io/json.hpp.

◆ nonnumeric_numbers()

json_reader_options_builder& cudf::io::json_reader_options_builder::nonnumeric_numbers ( bool  val)
inline

Set whether specific unquoted number values are valid JSON. The values are NaN, +INF, -INF, +Infinity, Infinity, and -Infinity. Strict validation must be enabled for this to have any effect.

Exceptions
cudf::logic_errorif strict_validation is not enabled before setting this option.
Parameters
valBoolean value to indicate if unquoted nonnumeric values are valid json or not.
Returns
this for chaining

Definition at line 860 of file io/json.hpp.

◆ normalize_single_quotes()

json_reader_options_builder& cudf::io::json_reader_options_builder::normalize_single_quotes ( bool  val)
inline

Set whether the reader should normalize single quotes around strings.

Parameters
valBoolean value to indicate whether the reader should normalize single quotes of strings
Returns
this for chaining

Definition at line 792 of file io/json.hpp.

◆ normalize_whitespace()

json_reader_options_builder& cudf::io::json_reader_options_builder::normalize_whitespace ( bool  val)
inline

Set whether the reader should normalize unquoted whitespace.

Parameters
valBoolean value to indicate whether the reader should normalize unquoted whitespace
Returns
this for chaining

Definition at line 805 of file io/json.hpp.

◆ numeric_leading_zeros()

json_reader_options_builder& cudf::io::json_reader_options_builder::numeric_leading_zeros ( bool  val)
inline

Set Whether leading zeros are allowed in numeric values. Strict validation must be enabled for this to have any effect.

Exceptions
cudf::logic_errorif strict_validation is not enabled before setting this option.
Parameters
valBoolean value to indicate whether leading zeros are allowed in numeric values
Returns
this for chaining

Definition at line 844 of file io/json.hpp.

◆ prune_columns()

json_reader_options_builder& cudf::io::json_reader_options_builder::prune_columns ( bool  val)
inline

Set whether to prune columns on read, selected based on the dtypes option.

When set as true, if the reader options include dtypes, then the reader will only return those columns which are mentioned in dtypes. If false, then all columns are returned, independent of the dtypes setting.

Parameters
valBoolean value to enable/disable column pruning
Returns
this for chaining

Definition at line 739 of file io/json.hpp.

◆ recovery_mode()

json_reader_options_builder& cudf::io::json_reader_options_builder::recovery_mode ( json_recovery_mode_t  val)
inline

Specifies the JSON reader's behavior on invalid JSON lines.

Parameters
valAn enum value to indicate the JSON reader's behavior on invalid JSON lines.
Returns
this for chaining

Definition at line 817 of file io/json.hpp.

◆ strict_validation()

json_reader_options_builder& cudf::io::json_reader_options_builder::strict_validation ( bool  val)
inline

Set whether json validation should be strict or not.

Parameters
valBoolean value to indicate whether json validation should be strict or not.
Returns
this for chaining

Definition at line 829 of file io/json.hpp.

◆ unquoted_control_chars()

json_reader_options_builder& cudf::io::json_reader_options_builder::unquoted_control_chars ( bool  val)
inline

Set whether chars >= 0 and < 32 are allowed in a quoted string without some form of escaping. Strict validation must be enabled for this to have any effect.

Exceptions
cudf::logic_errorif strict_validation is not enabled before setting this option.
Parameters
valBoolean value to indicate if unquoted control chars are allowed or not.
Returns
this for chaining

Definition at line 875 of file io/json.hpp.


The documentation for this class was generated from the following file: