Documentation
¶
Index ¶
- Variables
- func CheckedClose(c io.Closer, err *error)
- func Counter(start int) iter.Seq[int]
- func DecimalRequiredBytes(precision int) int
- func DecimalSchema(precision, scale int) avro.Schema
- func Difference(a, b []string) []string
- func Must[T any](v T, err error) T
- func NewManifestEntrySchema(partitionType avro.Schema, version int) (avro.Schema, error)
- func NewManifestFileSchema(version int) (avro.Schema, error)
- func NullableSchema(schema avro.Schema) avro.Schema
- func PackingIterator[T any](itr iter.Seq[T], targetWeight int64, lookback int, weightFunc func(T) int64, ...) iter.Seq[[]T]
- func RecoverError(err *error)
- func SliceEqualHelper[T interface{ ... }](s1, s2 []T) bool
- func WithElementID(id int) avro.SchemaOption
- func WithFieldID(id int) avro.SchemaOption
- type Bin
- type CountingWriter
- type MockFS
- type MockFSReadFile
- type MockFile
- func (m *MockFile) Close() error
- func (m *MockFile) Read(p []byte) (int, error)
- func (m *MockFile) ReadAt(p []byte, off int64) (n int, err error)
- func (m *MockFile) ReadFrom(r sio.Reader) (n int64, err error)
- func (m *MockFile) Seek(offset int64, whence int) (n int64, err error)
- func (m *MockFile) Stat() (fs.FileInfo, error)
- func (m *MockFile) Write(p []byte) (n int, err error)
- type SlicePacker
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NullSchema = avro.NewNullSchema() BoolSchema = avro.NewPrimitiveSchema(avro.Boolean, nil) NullableBoolSchema = NullableSchema(BoolSchema) BinarySchema = avro.NewPrimitiveSchema(avro.Bytes, nil) NullableBinarySchema = NullableSchema(BinarySchema) StringSchema = avro.NewPrimitiveSchema(avro.String, nil) IntSchema = avro.NewPrimitiveSchema(avro.Int, nil) NullableIntSchema = NullableSchema(IntSchema) LongSchema = avro.NewPrimitiveSchema(avro.Long, nil) NullableLongSchema = NullableSchema(LongSchema) FloatSchema = avro.NewPrimitiveSchema(avro.Float, nil) DoubleSchema = avro.NewPrimitiveSchema(avro.Double, nil) DateSchema = avro.NewPrimitiveSchema(avro.Int, avro.NewPrimitiveLogicalSchema(avro.Date)) TimeSchema = avro.NewPrimitiveSchema(avro.Long, avro.NewPrimitiveLogicalSchema(avro.TimeMicros)) TimestampSchema = avro.NewPrimitiveSchema(avro.Long, avro.NewPrimitiveLogicalSchema(avro.TimestampMicros), avro.WithProps(map[string]any{"adjust-to-utc": false})) TimestampTzSchema = avro.NewPrimitiveSchema(avro.Long, avro.NewPrimitiveLogicalSchema(avro.TimestampMicros), avro.WithProps(map[string]any{"adjust-to-utc": true})) UUIDSchema = Must(avro.NewFixedSchema("uuid", "", 16, avro.NewPrimitiveLogicalSchema(avro.UUID))) AvroSchemaCache avro.SchemaCache )
Functions ¶
func CheckedClose ¶
CheckedClose is a helper function to close a resource and return an error if it fails. It is intended to be used in a defer statement.
func DecimalRequiredBytes ¶
DecimalRequiredBytes returns the required number of bytes to store a decimal value of the given precision. If the precision is outside the range (0, 40], this returns -1 as it is invalid.
func DecimalSchema ¶
func Difference ¶
Helper function to find the difference between two slices (a - b).
func NewManifestEntrySchema ¶
func PackingIterator ¶
func RecoverError ¶
func RecoverError(err *error)
func SliceEqualHelper ¶
SliceEqualHelper compares the equality of two slices whose elements have an Equals method
func WithElementID ¶
func WithElementID(id int) avro.SchemaOption
func WithFieldID ¶
func WithFieldID(id int) avro.SchemaOption
Types ¶
type CountingWriter ¶
type MockFSReadFile ¶
type MockFile ¶
type SlicePacker ¶
func (*SlicePacker[T]) Pack ¶
func (s *SlicePacker[T]) Pack(items []T, weightFunc func(T) int64) [][]T
func (*SlicePacker[T]) PackEnd ¶
func (s *SlicePacker[T]) PackEnd(items []T, weightFunc func(T) int64) [][]T
Click to show internal directories.
Click to hide internal directories.