serializer

package
v0.0.0-rc12 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

README

Serializer

This package defines serializers interfaces, that serializes ChangeItems to []bytes

Supported Formats:

  • json
  • tsv
  • raw

#TODO

  • interface for byte stream serialization
  • add new serialization types

Documentation

Index

Constants

View Source
const (
	DefaultBatchSerializerThreshold = 25000
)

Variables

This section is empty.

Functions

func BuildParquetSchema

func BuildParquetSchema(tableSchema abstract.FastTableSchema) (*parquet.Schema, error)

func NewCsvBatchSerializer

func NewCsvBatchSerializer(config *CsvBatchSerializerConfig) *csvBatchSerializer

func NewCsvSerializer

func NewCsvSerializer() *csvSerializer

func NewCsvStreamSerializer

func NewCsvStreamSerializer(ostream io.Writer) *csvStreamSerializer

func NewJSONBatchSerializer

func NewJSONBatchSerializer(config *JSONBatchSerializerConfig) *jsonBatchSerializer

func NewJSONSerializer

func NewJSONSerializer(conf *JSONSerializerConfig) *jsonSerializer

func NewJSONStreamSerializer

func NewJSONStreamSerializer(ostream io.Writer, conf *JSONSerializerConfig) *jsonStreamSerializer

func NewParquetBatchSerializer

func NewParquetBatchSerializer() *parquetBatchSerializer

func NewParquetStreamSerializer

func NewParquetStreamSerializer(ostream io.Writer, schema *parquet.Schema, tableSchema abstract.FastTableSchema) (*parquetStreamSerializer, error)

func NewRawBatchSerializer

func NewRawBatchSerializer(config *RawBatchSerializerConfig) *rawBatchSerializer

func NewRawSerializer

func NewRawSerializer(conf *RawSerializerConfig) *rawSerializer

func NewRawStreamSerializer

func NewRawStreamSerializer(ostream io.Writer, conf *RawSerializerConfig) *rawStreamSerializer

Types

type BatchSerializer

type BatchSerializer interface {
	Serialize(items []*abstract.ChangeItem) ([]byte, error)
}

type BatchSerializerConfig

type BatchSerializerConfig struct {
	Concurrency int
	Threshold   int

	DisableConcurrency bool
}

type CsvBatchSerializerConfig

type CsvBatchSerializerConfig struct {
	BatchConfig *BatchSerializerConfig
}

type JSONBatchSerializerConfig

type JSONBatchSerializerConfig struct {
	SerializerConfig *JSONSerializerConfig
	BatchConfig      *BatchSerializerConfig
}

type JSONSerializerConfig

type JSONSerializerConfig struct {
	UnsupportedItemKinds map[abstract.Kind]bool
	AddClosingNewLine    bool
	AnyAsString          bool
}

type RawBatchSerializerConfig

type RawBatchSerializerConfig struct {
	SerializerConfig *RawSerializerConfig
	BatchConfig      *BatchSerializerConfig
}

type RawSerializerConfig

type RawSerializerConfig struct {
	AddClosingNewLine bool
}

type Serializer

type Serializer interface {
	Serialize(item *abstract.ChangeItem) ([]byte, error)
}

type StreamSerializer

type StreamSerializer interface {
	Serialize(items []*abstract.ChangeItem) error
	Close() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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