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

Settings to use for write_csv(). More...

#include <cudf/io/csv.hpp>

Public Member Functions

 csv_writer_options ()=default
 Default constructor. More...
 
sink_info const & get_sink () const
 Returns sink used for writer output. More...
 
table_view const & get_table () const
 Returns table that would be written to output. More...
 
std::vector< std::string > const & get_names () const
 Returns names of the columns. More...
 
std::string const & get_na_rep () const
 Returns string to used for null entries. More...
 
bool is_enabled_include_header () const
 Whether to write headers to csv. More...
 
size_type get_rows_per_chunk () const
 Returns maximum number of rows to process for each file write. More...
 
std::string const & get_line_terminator () const
 Returns character used for separating lines. More...
 
char get_inter_column_delimiter () const
 Returns character used for separating column values. More...
 
std::string const & get_true_value () const
 Returns string used for values != 0 in INT8 types. More...
 
std::string const & get_false_value () const
 Returns string used for values == 0 in INT8 types. More...
 
quote_style get_quoting () const
 Returns the quote style for the writer. More...
 
compression_type get_compression () const
 Returns the compression type for the output. More...
 
size_t get_compression_block_size () const
 Returns the size of the blocks that the output is compressed in. More...
 
void set_names (std::vector< std::string > names)
 Sets optional associated column names. More...
 
void set_na_rep (std::string val)
 Sets string to used for null entries. More...
 
void enable_include_header (bool val)
 Enables/Disables headers being written to csv. More...
 
void set_rows_per_chunk (size_type val)
 Sets maximum number of rows to process for each file write. More...
 
void set_line_terminator (std::string term)
 Sets character used for separating lines. More...
 
void set_inter_column_delimiter (char delim)
 Sets character used for separating column values. More...
 
void set_true_value (std::string val)
 Sets string used for values != 0 in INT8 types. More...
 
void set_false_value (std::string val)
 Sets string used for values == 0 in INT8 types. More...
 
void set_table (table_view const &table)
 (Re)sets the table being written. More...
 
void set_quoting (quote_style quoting)
 Sets the quote style for the writer. More...
 
void set_compression (compression_type comp)
 Sets the compression type for the output. More...
 
void set_compression_block_size (size_t size)
 Sets the size of the blocks that the output is compressed in. More...
 

Static Public Member Functions

static csv_writer_options_builder builder (sink_info const &sink, table_view const &table)
 Create builder to create csv_writer_options. More...
 

Detailed Description

Settings to use for write_csv().

Definition at line 1392 of file csv.hpp.

Constructor & Destructor Documentation

◆ csv_writer_options()

cudf::io::csv_writer_options::csv_writer_options ( )
explicitdefault

Default constructor.

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

Member Function Documentation

◆ builder()

static csv_writer_options_builder cudf::io::csv_writer_options::builder ( sink_info const &  sink,
table_view const &  table 
)
static

Create builder to create csv_writer_options.

Parameters
sinkThe sink used for writer output
tableTable to be written to output
Returns
Builder to build csv_writer_options

◆ enable_include_header()

void cudf::io::csv_writer_options::enable_include_header ( bool  val)
inline

Enables/Disables headers being written to csv.

Parameters
valBoolean value to enable/disable

Definition at line 1567 of file csv.hpp.

◆ get_compression()

compression_type cudf::io::csv_writer_options::get_compression ( ) const
inline

Returns the compression type for the output.

Returns
The compression type for the output

Definition at line 1538 of file csv.hpp.

◆ get_compression_block_size()

size_t cudf::io::csv_writer_options::get_compression_block_size ( ) const
inline

Returns the size of the blocks that the output is compressed in.

Returns
The compression block size, in bytes

Definition at line 1545 of file csv.hpp.

◆ get_false_value()

std::string const& cudf::io::csv_writer_options::get_false_value ( ) const
inline

Returns string used for values == 0 in INT8 types.

Returns
string used for values == 0 in INT8 types

Definition at line 1519 of file csv.hpp.

◆ get_inter_column_delimiter()

char cudf::io::csv_writer_options::get_inter_column_delimiter ( ) const
inline

Returns character used for separating column values.

Returns
Character used for separating column values.

Definition at line 1505 of file csv.hpp.

◆ get_line_terminator()

std::string const& cudf::io::csv_writer_options::get_line_terminator ( ) const
inline

Returns character used for separating lines.

Returns
Character used for separating lines

Definition at line 1498 of file csv.hpp.

◆ get_na_rep()

std::string const& cudf::io::csv_writer_options::get_na_rep ( ) const
inline

Returns string to used for null entries.

Returns
string to used for null entries

Definition at line 1477 of file csv.hpp.

◆ get_names()

std::vector<std::string> const& cudf::io::csv_writer_options::get_names ( ) const
inline

Returns names of the columns.

Returns
Names of the columns in the output file

Definition at line 1470 of file csv.hpp.

◆ get_quoting()

quote_style cudf::io::csv_writer_options::get_quoting ( ) const
inline

Returns the quote style for the writer.

Note: Only MINIMAL and NONE are supported.

  1. MINIMAL: String columns containing special characters like row-delimiters field-delimiter/quotes will be quoted.
  2. NONE: No quoting is done for any columns.
Returns
quote_style The quote style for the writer

Definition at line 1531 of file csv.hpp.

◆ get_rows_per_chunk()

size_type cudf::io::csv_writer_options::get_rows_per_chunk ( ) const
inline

Returns maximum number of rows to process for each file write.

Returns
Maximum number of rows to process for each file write

Definition at line 1491 of file csv.hpp.

◆ get_sink()

sink_info const& cudf::io::csv_writer_options::get_sink ( ) const
inline

Returns sink used for writer output.

Returns
sink used for writer output

Definition at line 1456 of file csv.hpp.

◆ get_table()

table_view const& cudf::io::csv_writer_options::get_table ( ) const
inline

Returns table that would be written to output.

Returns
Table that would be written to output

Definition at line 1463 of file csv.hpp.

◆ get_true_value()

std::string const& cudf::io::csv_writer_options::get_true_value ( ) const
inline

Returns string used for values != 0 in INT8 types.

Returns
string used for values != 0 in INT8 types

Definition at line 1512 of file csv.hpp.

◆ is_enabled_include_header()

bool cudf::io::csv_writer_options::is_enabled_include_header ( ) const
inline

Whether to write headers to csv.

Returns
true if writing headers to csv

Definition at line 1484 of file csv.hpp.

◆ set_compression()

void cudf::io::csv_writer_options::set_compression ( compression_type  comp)
inline

Sets the compression type for the output.

Only ZSTD is supported: concatenated frames let the chunks be compressed as they are written while keeping the output readable by standard tools.

Parameters
compThe compression type (NONE or ZSTD only)
Exceptions
cudf::logic_errorif compression type is not NONE or ZSTD

Definition at line 1637 of file csv.hpp.

◆ set_compression_block_size()

void cudf::io::csv_writer_options::set_compression_block_size ( size_t  size)
inline

Sets the size of the blocks that the output is compressed in.

Each block becomes its own frame, so the codec can compress them in parallel. Independent of rows_per_chunk, and capped at the codec's maximum input size.

Parameters
sizeThe compression block size, in bytes
Exceptions
cudf::logic_errorif the block size is zero

Definition at line 1653 of file csv.hpp.

◆ set_false_value()

void cudf::io::csv_writer_options::set_false_value ( std::string  val)
inline

Sets string used for values == 0 in INT8 types.

Parameters
valString to represent values == 0 in INT8 types

Definition at line 1602 of file csv.hpp.

◆ set_inter_column_delimiter()

void cudf::io::csv_writer_options::set_inter_column_delimiter ( char  delim)
inline

Sets character used for separating column values.

Parameters
delimCharacter to delimit column values

Definition at line 1588 of file csv.hpp.

◆ set_line_terminator()

void cudf::io::csv_writer_options::set_line_terminator ( std::string  term)
inline

Sets character used for separating lines.

Parameters
termCharacter to represent line termination

Definition at line 1581 of file csv.hpp.

◆ set_na_rep()

void cudf::io::csv_writer_options::set_na_rep ( std::string  val)
inline

Sets string to used for null entries.

Parameters
valString to represent null value

Definition at line 1560 of file csv.hpp.

◆ set_names()

void cudf::io::csv_writer_options::set_names ( std::vector< std::string >  names)
inline

Sets optional associated column names.

Parameters
namesAssociated column names

Definition at line 1553 of file csv.hpp.

◆ set_quoting()

void cudf::io::csv_writer_options::set_quoting ( quote_style  quoting)
inline

Sets the quote style for the writer.

Note: Only the following quote styles are supported:

  1. MINIMAL: String columns containing special characters like row-delimiters/ field-delimiter/quotes will be quoted.
  2. NONE: No quoting is done for any columns.
Parameters
quotingThe new quote_style for the writer.

Definition at line 1621 of file csv.hpp.

◆ set_rows_per_chunk()

void cudf::io::csv_writer_options::set_rows_per_chunk ( size_type  val)
inline

Sets maximum number of rows to process for each file write.

Parameters
valNumber of rows per chunk

Definition at line 1574 of file csv.hpp.

◆ set_table()

void cudf::io::csv_writer_options::set_table ( table_view const &  table)
inline

(Re)sets the table being written.

Parameters
tableTable to be written

Definition at line 1609 of file csv.hpp.

◆ set_true_value()

void cudf::io::csv_writer_options::set_true_value ( std::string  val)
inline

Sets string used for values != 0 in INT8 types.

Parameters
valString to represent values != 0 in INT8 types

Definition at line 1595 of file csv.hpp.


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