Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CsvReader ¶
type CsvReader struct {
// contains filtered or unexported fields
}
CsvReader implements dio.Reader for CSV files.
func NewReader ¶
func NewReader(path string, opts ...ReaderOption) (*CsvReader, error)
NewReader creates a CSV Reader from a file path. The schema is eagerly inferred by opening the file and reading the first record.
func (*CsvReader) Read ¶
func (r *CsvReader) Read(ctx context.Context, opts ...dio.ReadOption) (dio.BatchStream, error)
Read opens a stream of Arrow RecordBatches from the CSV file. Each call re-opens the file, supporting multiple reads.
type CsvWriter ¶
type CsvWriter struct {
// contains filtered or unexported fields
}
CsvWriter implements dio.Writer for CSV files.
func NewWriter ¶
func NewWriter(w io.Writer, opts ...WriterOption) *CsvWriter
NewWriterFromWriter creates a CSV Writer that writes to any io.Writer.
func (*CsvWriter) Close ¶
Close finalizes the CSV writer. Only closes the underlying file if the writer was created via NewWriter (path-based constructor).
func (*CsvWriter) WriteStream ¶
WriteStream writes all records from the stream to the CSV file.
type ReaderOption ¶
type ReaderOption func(*readerConfig)
ReaderOption configures a CsvReader.
func WithBatchSize ¶
func WithBatchSize(size int) ReaderOption
WithBatchSize sets the number of rows per batch.
func WithDelimiter ¶
func WithDelimiter(delim rune) ReaderOption
WithDelimiter sets the field separator character.
func WithHeader ¶
func WithHeader(header bool) ReaderOption
WithHeader sets whether the first row contains column names.
func WithNullValues ¶
func WithNullValues(values []string) ReaderOption
WithNullValues sets the strings that should be interpreted as NULL.
func WithSchema ¶
func WithSchema(schema *arrow.Schema) ReaderOption
WithSchema sets an explicit schema. If nil, schema is inferred.
type WriterOption ¶
type WriterOption func(*writerConfig)
WriterOption configures a CsvWriter.
func WithWriterDelimiter ¶
func WithWriterDelimiter(delim rune) WriterOption
WithWriterDelimiter sets the field separator character for writing.
func WithWriterHeader ¶
func WithWriterHeader(header bool) WriterOption
WithWriterHeader sets whether to write a header row.