Documentation
¶
Index ¶
- Variables
- func CheckedClose(c io.Closer, err *error)
- func Counter(start int) iter.Seq[int]
- func DecimalNode(precision, scale int) avro.SchemaNode
- func DecimalRequiredBytes(precision int) int
- func DecimalSchema(precision, scale int) *avro.Schema
- func Difference(a, b []string) []string
- func FixedNode(size int) avro.SchemaNode
- func FixedSchema(size int) *avro.Schema
- 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 NullableNode(node avro.SchemaNode) avro.SchemaNode
- 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 SingleErrorIter[T any](err error) iter.Seq2[T, error]
- func SliceEqualHelper[T interface{ ... }](s1, s2 []T) bool
- func WithFieldID(id int) map[string]any
- 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 ¶
var ( NullNode = avro.SchemaNode{Type: atype.Null} BoolNode = avro.SchemaNode{Type: atype.Boolean} IntNode = avro.SchemaNode{Type: atype.Int} LongNode = avro.SchemaNode{Type: atype.Long} FloatNode = avro.SchemaNode{Type: atype.Float} DoubleNode = avro.SchemaNode{Type: atype.Double} StringNode = avro.SchemaNode{Type: atype.String} BytesNode = avro.SchemaNode{Type: atype.Bytes} DateNode = avro.SchemaNode{Type: atype.Int, LogicalType: atype.Date} TimeNode = avro.SchemaNode{Type: atype.Long, LogicalType: atype.TimeMicros} TimestampNode = avro.SchemaNode{Type: atype.Long, LogicalType: atype.TimestampMicros, Props: map[string]any{"adjust-to-utc": false}} TimestampTzNode = avro.SchemaNode{Type: atype.Long, LogicalType: atype.TimestampMicros, Props: map[string]any{"adjust-to-utc": true}} UUIDNode = avro.SchemaNode{Type: atype.Fixed, Name: "uuid_fixed", Size: 16, LogicalType: atype.UUID} )
Schema nodes for reuse in composition.
var ( NullSchema = mustSchema(NullNode) BoolSchema = mustSchema(BoolNode) NullableBoolSchema = NullableSchema(BoolSchema) BinarySchema = mustSchema(BytesNode) NullableBinarySchema = NullableSchema(BinarySchema) StringSchema = mustSchema(StringNode) IntSchema = mustSchema(IntNode) NullableIntSchema = NullableSchema(IntSchema) LongSchema = mustSchema(LongNode) NullableLongSchema = NullableSchema(LongSchema) FloatSchema = mustSchema(FloatNode) DoubleSchema = mustSchema(DoubleNode) DateSchema = mustSchema(DateNode) TimeSchema = mustSchema(TimeNode) TimestampSchema = mustSchema(TimestampNode) TimestampTzSchema = mustSchema(TimestampTzNode) UUIDSchema = mustSchema(UUIDNode) )
Compiled schemas for direct encoding/decoding use.
var AvroSchemaMap = make(map[string]*avro.Schema)
AvroSchemaMap stores prebuilt schemas by name for lookup.
Functions ¶
func CheckedClose ¶ added in v0.4.0
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 DecimalNode ¶ added in v0.6.0
func DecimalNode(precision, scale int) avro.SchemaNode
func DecimalRequiredBytes ¶ added in v0.2.0
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 ¶ added in v0.2.0
func Difference ¶ added in v0.2.0
Helper function to find the difference between two slices (a - b).
func FixedNode ¶ added in v0.6.0
func FixedNode(size int) avro.SchemaNode
func FixedSchema ¶ added in v0.6.0
func NewManifestEntrySchema ¶ added in v0.2.0
func NewManifestFileSchema ¶ added in v0.2.0
func NullableNode ¶ added in v0.6.0
func NullableNode(node avro.SchemaNode) avro.SchemaNode
func PackingIterator ¶ added in v0.3.0
func RecoverError ¶ added in v0.2.0
func RecoverError(err *error)
func SliceEqualHelper ¶ added in v0.5.0
SliceEqualHelper compares the equality of two slices whose elements have an Equals method
func WithFieldID ¶ added in v0.2.0
WithFieldID returns a props map for use with SchemaField for Iceberg field IDs.
Types ¶
type CountingWriter ¶ added in v0.2.0
type MockFSReadFile ¶
type MockFile ¶
type MockFile struct {
Contents *bytes.Reader
ErrOnClose bool
// contains filtered or unexported fields
}
type SlicePacker ¶ added in v0.2.0
func (*SlicePacker[T]) Pack ¶ added in v0.2.0
func (s *SlicePacker[T]) Pack(items []T, weightFunc func(T) int64) [][]T
func (*SlicePacker[T]) PackEnd ¶ added in v0.2.0
func (s *SlicePacker[T]) PackEnd(items []T, weightFunc func(T) int64) [][]T
Directories
¶
| Path | Synopsis |
|---|---|
|
Package datafileavro is an internal bridge that lets the github.com/apache/iceberg-go/codec package consume the iceberg package's manifest-entry Avro decoder without iceberg having to export it publicly.
|
Package datafileavro is an internal bridge that lets the github.com/apache/iceberg-go/codec package consume the iceberg package's manifest-entry Avro decoder without iceberg having to export it publicly. |