Avro#

class pylibcudf.io.avro.AvroReaderOptions#

The settings to use for read_avro For details, see cudf::io::avro_reader_options

Methods

builder(SourceInfo source)

Create a AvroWriterOptionsBuilder object

set_columns(self, list col_names)

Set names of the column to be read.

set_source(self, SourceInfo src)

Set a new source info location.

static builder(
SourceInfo source,
) AvroReaderOptionsBuilder#

Create a AvroWriterOptionsBuilder object

For details, see cudf::io::avro_reader_options::builder()

Parameters:
sinkSourceInfo

The source to read the Avro file from.

Returns:
AvroReaderOptionsBuilder

Builder to build AvroReaderOptions

set_columns(self, list col_names: list[str]) void#

Set names of the column to be read.

Parameters:
col_nameslist[str]

List of column names

Returns:
None
set_source(self, SourceInfo src) void#

Set a new source info location.

Parameters:
srcSourceInfo

New source information, replacing existing information.

Returns:
None
class pylibcudf.io.avro.AvroReaderOptionsBuilder#

Builder to build options for read_avro.

Methods

build(self)

Create a AvroReaderOptions object

columns(self, list col_names)

Set names of the column to be read.

num_rows(self, size_type num_rows)

Sets number of rows to read.

skip_rows(self, size_type skip_rows)

Sets number of rows to skip.

build(self) AvroReaderOptions#

Create a AvroReaderOptions object

columns(self, list col_names: list[str]) AvroReaderOptionsBuilder#

Set names of the column to be read.

Parameters:
col_nameslist

List of column names

Returns:
AvroReaderOptionsBuilder
num_rows(
self,
size_type num_rows,
) AvroReaderOptionsBuilder#

Sets number of rows to read.

Parameters:
num_rowssize_type

Number of rows to read after skip

Returns:
AvroReaderOptionsBuilder
skip_rows(
self,
size_type skip_rows,
) AvroReaderOptionsBuilder#

Sets number of rows to skip.

Parameters:
skip_rowssize_type

Number of rows to skip from start

Returns:
AvroReaderOptionsBuilder
pylibcudf.io.avro.read_avro(
AvroReaderOptions options,
stream: CudaStreamLike | None = None,
DeviceMemoryResource mr=None,
) TableWithMetadata#

Read from Avro format.

The source to read from and options are encapsulated by the options object.

For details, see read_avro().

Parameters:
options: AvroReaderOptions

Settings for controlling reading behavior

streamStream | None

CUDA stream used for device memory operations and kernel launches

mrDeviceMemoryResource, optional

Device memory resource used to allocate the returned table’s device memory.