writers

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: 12 Imported by: 0

Documentation

Overview

Package writers provides implementations of dataset writers for various data formats.

Index

Constants

This section is empty.

Variables

View Source
var DefaultFactory = NewFactory()

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

Functions

func NewArrowWriter

func NewArrowWriter(config core.WriterConfig) (core.DatasetWriter, error)

NewArrowWriter creates a new Arrow IPC writer.

func NewJSONWriter

func NewJSONWriter(config core.WriterConfig) (core.DatasetWriter, error)

NewJSONWriter creates a new JSON writer.

func NewParquetWriter

func NewParquetWriter(config core.WriterConfig) (core.DatasetWriter, error)

NewParquetWriter creates a new Parquet writer.

Types

type ArrowWriter

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

ArrowWriter implements a writer for Arrow IPC files.

func (*ArrowWriter) Close

func (w *ArrowWriter) Close() error

Close closes the writer and flushes any pending data.

func (*ArrowWriter) Write

func (w *ArrowWriter) Write(ctx context.Context, record arrow.Record) error

Write writes a record to the file.

type Creator

type Creator func(config core.WriterConfig) (core.DatasetWriter, error)

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

type Factory

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

Factory creates a writer based on the given configuration.

func NewFactory

func NewFactory() *Factory

NewFactory creates a new writer factory.

func (*Factory) Create

func (f *Factory) Create(config core.WriterConfig) (core.DatasetWriter, error)

Create creates a writer based on the given configuration.

func (*Factory) Register

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

Register registers a creator for a writer type.

type JSONWriter

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

JSONWriter implements a writer for JSON files.

func (*JSONWriter) Close

func (w *JSONWriter) Close() error

Close closes the writer and flushes any pending data.

func (*JSONWriter) Write

func (w *JSONWriter) Write(ctx context.Context, record arrow.Record) error

Write writes a record to the file.

type ParquetWriter

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

ParquetWriter implements a writer for Parquet files.

func (*ParquetWriter) Close

func (w *ParquetWriter) Close() error

Close closes the writer and flushes any pending data.

func (*ParquetWriter) Write

func (w *ParquetWriter) Write(ctx context.Context, record arrow.Record) error

Write writes a record to the file.

Jump to

Keyboard shortcuts

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