readers

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package readers provides implementations of dataset readers for various data sources.

Index

Constants

This section is empty.

Variables

View Source
var DefaultFactory = NewFactory()

DefaultFactory is the default reader factory with built-in reader types.

Functions

func NewArrowReader

func NewArrowReader(config core.ReaderConfig) (core.DatasetReader, error)

NewArrowReader creates a new Arrow IPC reader.

func NewCSVReader

func NewCSVReader(config core.ReaderConfig) (core.DatasetReader, error)

NewCSVReader creates a new CSV reader.

func NewParquetReader

func NewParquetReader(config core.ReaderConfig) (core.DatasetReader, error)

NewParquetReader creates a new Parquet reader.

Types

type ArrowReader

type ArrowReader struct {
	// contains filtered or unexported fields
}

ArrowReader implements a reader for Arrow IPC files.

func (*ArrowReader) Close

func (r *ArrowReader) Close() error

Close closes the reader and releases resources.

func (*ArrowReader) Read

func (r *ArrowReader) Read(ctx context.Context) (arrow.Record, error)

Read returns the next batch of records.

func (*ArrowReader) Schema

func (r *ArrowReader) Schema() *arrow.Schema

Schema returns the schema of the dataset.

type CSVReader

type CSVReader struct {
	// contains filtered or unexported fields
}

CSVReader implements a reader for CSV files, converting to Arrow.

func (*CSVReader) Close

func (r *CSVReader) Close() error

Close closes the reader and releases resources.

func (*CSVReader) Read

func (r *CSVReader) Read(ctx context.Context) (arrow.Record, error)

Read returns the next batch of records.

func (*CSVReader) Schema

func (r *CSVReader) Schema() *arrow.Schema

Schema returns the schema of the dataset.

type Creator

type Creator func(config core.ReaderConfig) (core.DatasetReader, error)

Creator is a function that creates a reader from a configuration.

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

Factory creates a reader based on the given configuration.

func NewFactory

func NewFactory() *Factory

NewFactory creates a new reader factory.

func (*Factory) Create

func (f *Factory) Create(config core.ReaderConfig) (core.DatasetReader, error)

Create creates a reader based on the given configuration.

func (*Factory) Register

func (f *Factory) Register(typ string, creator Creator)

Register registers a creator for a reader type.

type ParquetReader

type ParquetReader struct {
	// contains filtered or unexported fields
}

ParquetReader implements a reader for Parquet files.

func (*ParquetReader) Close

func (r *ParquetReader) Close() error

Close closes the reader and releases resources.

func (*ParquetReader) Read

func (r *ParquetReader) Read(ctx context.Context) (arrow.Record, error)

Read returns the next batch of records.

func (*ParquetReader) Schema

func (r *ParquetReader) Schema() *arrow.Schema

Schema returns the schema of the dataset.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL