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 847 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 863 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 1334 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 883 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 895 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 1063 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 871 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 1304 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 1051 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 1087 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 1027 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 1160 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 1147 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 1220 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 1232 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 1256 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 1003 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 1280 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 1015 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 931 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 1292 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 1268 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 907 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 967 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 1184 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 1172 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 1208 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 1196 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 919 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 1135 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 1123 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 1111 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 991 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 1099 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 979 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 1039 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 1316 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 1244 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 955 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 943 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 1075 of file csv.hpp.


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