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

Builder to build options for read_csv(). More...

#include <csv.hpp>

Public Member Functions

 csv_reader_options_builder ()=default
 Default constructor. More...
 
 csv_reader_options_builder (source_info src)
 Constructor from source info. More...
 
csv_reader_options_buildercompression (compression_type comp)
 Sets compression format of the source. More...
 
csv_reader_options_builderbyte_range_offset (std::size_t offset)
 Sets number of bytes to skip from source start. More...
 
csv_reader_options_builderbyte_range_size (std::size_t size)
 Sets number of bytes to read. More...
 
csv_reader_options_buildernames (std::vector< std::string > col_names)
 Sets names of the column. More...
 
csv_reader_options_builderprefix (std::string pfx)
 Sets prefix to be used for column ID. More...
 
csv_reader_options_buildermangle_dupe_cols (bool val)
 Sets whether to rename duplicate column names. More...
 
csv_reader_options_builderuse_cols_names (std::vector< std::string > col_names)
 Sets names of the columns to be read. More...
 
csv_reader_options_builderuse_cols_indexes (std::vector< int > col_indices)
 Sets indexes of columns to read. More...
 
csv_reader_options_buildernrows (size_type rows)
 Sets number of rows to read. More...
 
csv_reader_options_builderskiprows (size_type skip)
 Sets number of rows to skip from start. More...
 
csv_reader_options_builderskipfooter (size_type skip)
 Sets number of rows to skip from end. More...
 
csv_reader_options_builderheader (size_type hdr)
 Sets header row index. More...
 
csv_reader_options_builderlineterminator (char term)
 Sets line terminator. More...
 
csv_reader_options_builderdelimiter (char delim)
 Sets field delimiter. More...
 
csv_reader_options_builderthousands (char val)
 Sets numeric data thousands separator. More...
 
csv_reader_options_builderdecimal (char val)
 Sets decimal point character. More...
 
csv_reader_options_buildercomment (char val)
 Sets comment line start character. More...
 
csv_reader_options_builderwindowslinetermination (bool val)
 Sets whether to treat \r\n as line terminator. More...
 
csv_reader_options_builderdelim_whitespace (bool val)
 Sets whether to treat whitespace as field delimiter. More...
 
csv_reader_options_builderskipinitialspace (bool val)
 Sets whether to skip whitespace after the delimiter. More...
 
csv_reader_options_builderskip_blank_lines (bool val)
 Sets whether to ignore empty lines or parse line values as invalid. More...
 
csv_reader_options_builderquoting (quote_style style)
 Sets quoting style. More...
 
csv_reader_options_builderquotechar (char ch)
 Sets quoting character. More...
 
csv_reader_options_builderdoublequote (bool val)
 Sets a quote inside a value is double-quoted. More...
 
csv_reader_options_builderdetect_whitespace_around_quotes (bool val)
 Sets whether to detect quotes surrounded by spaces e.g. "data". This flag has no effect when _doublequote is true. More...
 
csv_reader_options_builderparse_dates (std::vector< std::string > col_names)
 Sets names of columns to read as datetime. More...
 
csv_reader_options_builderparse_dates (std::vector< int > col_indices)
 Sets indexes of columns to read as datetime. More...
 
csv_reader_options_builderparse_hex (std::vector< std::string > col_names)
 Sets names of columns to parse as hexadecimal. More...
 
csv_reader_options_builderparse_hex (std::vector< int > col_indices)
 Sets indexes of columns to parse as hexadecimal. More...
 
csv_reader_options_builderdtypes (std::map< std::string, data_type > types)
 Sets per-column types. More...
 
csv_reader_options_builderdtypes (std::vector< data_type > types)
 Sets per-column types. More...
 
csv_reader_options_buildertrue_values (std::vector< std::string > vals)
 Sets additional values to recognize as boolean true values. More...
 
csv_reader_options_builderfalse_values (std::vector< std::string > vals)
 Sets additional values to recognize as boolean false values. More...
 
csv_reader_options_builderna_values (std::vector< std::string > vals)
 Sets additional values to recognize as null values. More...
 
csv_reader_options_builderkeep_default_na (bool val)
 Sets whether to keep the built-in default NA values. More...
 
csv_reader_options_builderna_filter (bool val)
 Sets whether to disable null filter. More...
 
csv_reader_options_builderdayfirst (bool val)
 Sets whether to parse dates as DD/MM versus MM/DD. More...
 
csv_reader_options_buildertimestamp_type (data_type type)
 Sets timestamp_type to which all timestamp columns will be cast. More...
 
 operator csv_reader_options && ()
 move csv_reader_options member once it's built.
 
csv_reader_options && build ()
 move csv_reader_options member once it's built. More...
 

Detailed Description

Builder to build options for read_csv().

Definition at line 845 of file csv.hpp.

Constructor & Destructor Documentation

◆ csv_reader_options_builder() [1/2]

cudf::io::csv_reader_options_builder::csv_reader_options_builder ( )
default

Default constructor.

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

◆ csv_reader_options_builder() [2/2]

cudf::io::csv_reader_options_builder::csv_reader_options_builder ( source_info  src)
inline

Constructor from source info.

Parameters
srcThe source information used to read csv file

Definition at line 861 of file csv.hpp.

Member Function Documentation

◆ build()

csv_reader_options&& cudf::io::csv_reader_options_builder::build ( )
inline

move csv_reader_options member once it's built.

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

Returns
Built csv_reader_options object's r-value reference

Definition at line 1332 of file csv.hpp.

◆ byte_range_offset()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::byte_range_offset ( std::size_t  offset)
inline

Sets number of bytes to skip from source start.

Parameters
offsetNumber of bytes of offset
Returns
this for chaining

Definition at line 881 of file csv.hpp.

◆ byte_range_size()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::byte_range_size ( std::size_t  size)
inline

Sets number of bytes to read.

Parameters
sizeNumber of bytes to read
Returns
this for chaining

Definition at line 893 of file csv.hpp.

◆ comment()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::comment ( char  val)
inline

Sets comment line start character.

Parameters
valA character that indicates comment
Returns
this for chaining

Definition at line 1061 of file csv.hpp.

◆ compression()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::compression ( compression_type  comp)
inline

Sets compression format of the source.

Parameters
compCompression type
Returns
this for chaining

Definition at line 869 of file csv.hpp.

◆ dayfirst()

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

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

Parameters
valBoolean value to enable/disable
Returns
this for chaining

Definition at line 1302 of file csv.hpp.

◆ decimal()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::decimal ( char  val)
inline

Sets decimal point character.

Parameters
valA character that indicates decimal values
Returns
this for chaining

Definition at line 1049 of file csv.hpp.

◆ delim_whitespace()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::delim_whitespace ( bool  val)
inline

Sets whether to treat whitespace as field delimiter.

Parameters
valBoolean value to enable/disable
Returns
this for chaining

Definition at line 1085 of file csv.hpp.

◆ delimiter()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::delimiter ( char  delim)
inline

Sets field delimiter.

Parameters
delimA character to indicate delimiter
Returns
this for chaining

Definition at line 1025 of file csv.hpp.

◆ detect_whitespace_around_quotes()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::detect_whitespace_around_quotes ( bool  val)
inline

Sets whether to detect quotes surrounded by spaces e.g. "data". This flag has no effect when _doublequote is true.

Parameters
valBoolean value to enable/disable
Returns
this for chaining

Definition at line 1158 of file csv.hpp.

◆ doublequote()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::doublequote ( bool  val)
inline

Sets a quote inside a value is double-quoted.

Parameters
valBoolean value to enable/disable
Returns
this for chaining

Definition at line 1145 of file csv.hpp.

◆ dtypes() [1/2]

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

Sets per-column types.

Parameters
typesColumn name -> data type map specifying the columns' target data types
Returns
this for chaining

Definition at line 1218 of file csv.hpp.

◆ dtypes() [2/2]

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

Sets per-column types.

Parameters
typesVector of data types in which the column needs to be read
Returns
this for chaining

Definition at line 1230 of file csv.hpp.

◆ false_values()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::false_values ( std::vector< std::string >  vals)
inline

Sets additional values to recognize as boolean false values.

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

Definition at line 1254 of file csv.hpp.

◆ header()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::header ( size_type  hdr)
inline

Sets header row index.

Parameters
hdrIndex where header row is located
Returns
this for chaining

Definition at line 1001 of file csv.hpp.

◆ keep_default_na()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::keep_default_na ( bool  val)
inline

Sets whether to keep the built-in default NA values.

Parameters
valBoolean value to enable/disable
Returns
this for chaining

Definition at line 1278 of file csv.hpp.

◆ lineterminator()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::lineterminator ( char  term)
inline

Sets line terminator.

Parameters
termA character to indicate line termination
Returns
this for chaining

Definition at line 1013 of file csv.hpp.

◆ mangle_dupe_cols()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::mangle_dupe_cols ( bool  val)
inline

Sets whether to rename duplicate column names.

Parameters
valBoolean value to enable/disable
Returns
this for chaining

Definition at line 929 of file csv.hpp.

◆ na_filter()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::na_filter ( bool  val)
inline

Sets whether to disable null filter.

Parameters
valBoolean value to enable/disable
Returns
this for chaining

Definition at line 1290 of file csv.hpp.

◆ na_values()

csv_reader_options_builder& cudf::io::csv_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 1266 of file csv.hpp.

◆ names()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::names ( std::vector< std::string >  col_names)
inline

Sets names of the column.

Parameters
col_namesVector of column names
Returns
this for chaining

Definition at line 905 of file csv.hpp.

◆ nrows()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::nrows ( size_type  rows)
inline

Sets number of rows to read.

Parameters
rowsNumber of rows to read
Returns
this for chaining

Definition at line 965 of file csv.hpp.

◆ parse_dates() [1/2]

csv_reader_options_builder& cudf::io::csv_reader_options_builder::parse_dates ( std::vector< int >  col_indices)
inline

Sets indexes of columns to read as datetime.

Parameters
col_indicesVector of column indices to read as datetime
Returns
this for chaining

Definition at line 1182 of file csv.hpp.

◆ parse_dates() [2/2]

csv_reader_options_builder& cudf::io::csv_reader_options_builder::parse_dates ( std::vector< std::string >  col_names)
inline

Sets names of columns to read as datetime.

Parameters
col_namesVector of column names to read as datetime
Returns
this for chaining

Definition at line 1170 of file csv.hpp.

◆ parse_hex() [1/2]

csv_reader_options_builder& cudf::io::csv_reader_options_builder::parse_hex ( std::vector< int >  col_indices)
inline

Sets indexes of columns to parse as hexadecimal.

Parameters
col_indicesVector of column indices to parse as hexadecimal
Returns
this for chaining

Definition at line 1206 of file csv.hpp.

◆ parse_hex() [2/2]

csv_reader_options_builder& cudf::io::csv_reader_options_builder::parse_hex ( std::vector< std::string >  col_names)
inline

Sets names of columns to parse as hexadecimal.

Parameters
col_namesVector of column names to parse as hexadecimal
Returns
this for chaining

Definition at line 1194 of file csv.hpp.

◆ prefix()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::prefix ( std::string  pfx)
inline

Sets prefix to be used for column ID.

Parameters
pfxString used as prefix in for each column name
Returns
this for chaining

Definition at line 917 of file csv.hpp.

◆ quotechar()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::quotechar ( char  ch)
inline

Sets quoting character.

Parameters
chA character to indicate quoting
Returns
this for chaining

Definition at line 1133 of file csv.hpp.

◆ quoting()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::quoting ( quote_style  style)
inline

Sets quoting style.

Parameters
styleQuoting style used
Returns
this for chaining

Definition at line 1121 of file csv.hpp.

◆ skip_blank_lines()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::skip_blank_lines ( bool  val)
inline

Sets whether to ignore empty lines or parse line values as invalid.

Parameters
valBoolean value to enable/disable
Returns
this for chaining

Definition at line 1109 of file csv.hpp.

◆ skipfooter()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::skipfooter ( size_type  skip)
inline

Sets number of rows to skip from end.

Parameters
skipNumber of rows to skip
Returns
this for chaining

Definition at line 989 of file csv.hpp.

◆ skipinitialspace()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::skipinitialspace ( bool  val)
inline

Sets whether to skip whitespace after the delimiter.

Parameters
valBoolean value to enable/disable
Returns
this for chaining

Definition at line 1097 of file csv.hpp.

◆ skiprows()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::skiprows ( size_type  skip)
inline

Sets number of rows to skip from start.

Parameters
skipNumber of rows to skip
Returns
this for chaining

Definition at line 977 of file csv.hpp.

◆ thousands()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::thousands ( char  val)
inline

Sets numeric data thousands separator.

Parameters
valA character that separates thousands
Returns
this for chaining

Definition at line 1037 of file csv.hpp.

◆ timestamp_type()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::timestamp_type ( data_type  type)
inline

Sets timestamp_type to which all timestamp columns will be cast.

Parameters
typeDtype to which all timestamp column will be cast
Returns
this for chaining

Definition at line 1314 of file csv.hpp.

◆ true_values()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::true_values ( std::vector< std::string >  vals)
inline

Sets additional values to recognize as boolean true values.

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

Definition at line 1242 of file csv.hpp.

◆ use_cols_indexes()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::use_cols_indexes ( std::vector< int >  col_indices)
inline

Sets indexes of columns to read.

Parameters
col_indicesVector of column indices that are needed
Returns
this for chaining

Definition at line 953 of file csv.hpp.

◆ use_cols_names()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::use_cols_names ( std::vector< std::string >  col_names)
inline

Sets names of the columns to be read.

Parameters
col_namesVector of column names that are needed
Returns
this for chaining

Definition at line 941 of file csv.hpp.

◆ windowslinetermination()

csv_reader_options_builder& cudf::io::csv_reader_options_builder::windowslinetermination ( bool  val)
inline

Sets whether to treat \r\n as line terminator.

Parameters
valBoolean value to enable/disable
Returns
this for chaining

Definition at line 1073 of file csv.hpp.


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