Documentation
¶
Index ¶
- Variables
- func BorrowedDataFileBounds(file DataFileStats) (lowerBounds, upperBounds map[int][]byte)
- func BorrowedDataFileCollections(file DataFileCollections) (columnSizes map[int]int64, keyMetadata []byte, splitOffsets []int64, ...)
- func BorrowedDataFilePartition(file DataFilePartition) map[int]any
- func BorrowedDataFilePointers(file DataFilePointers) (sortOrderID *int, firstRowID *int64, referencedDataFile *string, ...)
- func BorrowedDataFileReferencedDataFile(file DataFileReferencedDataFile) *string
- func BorrowedDataFileStats(file DataFileStats) (valueCounts map[int]int64, nullCounts map[int]int64, nanCounts map[int]int64, ...)
- func BorrowedManifestFilePartitions[T any](file ManifestFilePartitions[T]) []T
- 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 DecodeDefaultBytes(value string, fixedLen int) ([]byte, error)
- func Difference(a, b []string) []string
- func EncodeDefaultBytes(value []byte) string
- func FixedNode(size int) avro.SchemaNode
- func FixedSchema(size int) *avro.Schema
- func FloorDiv[T constraints.Integer](a, b T) T
- func MissingRequiredField(sentinel error, name string) error
- 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 BoundPredicateRef
- type CountingWriter
- type DataFileCollections
- type DataFileCollectionsRef
- type DataFilePartition
- type DataFilePartitionRef
- type DataFilePointers
- type DataFilePointersRef
- type DataFileRef
- type DataFileReferencedDataFile
- type DataFileReferencedDataFileRef
- type DataFileStats
- type DataFileStatsRef
- type ManifestFilePartitions
- type ManifestFileRef
- type ManifestPartitionBorrower
- 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 PartitionSpecRef
- type RequirementWire
- type SchemaRef
- 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}} TimestampNsNode = avro.SchemaNode{Type: atype.Long, LogicalType: atype.TimestampNanos, Props: map[string]any{"adjust-to-utc": false}} TimestampTzNsNode = avro.SchemaNode{Type: atype.Long, LogicalType: atype.TimestampNanos, 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 BorrowedDataFileBounds ¶ added in v0.7.0
func BorrowedDataFileBounds(file DataFileStats) (lowerBounds, upperBounds map[int][]byte)
BorrowedDataFileBounds returns the lower and upper bounds without copying for the built-in data file and falls back to the public getters for external implementations. The returned maps and byte slices are read-only borrows.
func BorrowedDataFileCollections ¶ added in v0.7.0
func BorrowedDataFilePartition ¶ added in v0.7.0
func BorrowedDataFilePartition(file DataFilePartition) map[int]any
BorrowedDataFilePartition returns a partition map without copying for the built-in data file and falls back to the public getter for external implementations. The returned map and its values must be treated as read-only and must not escape the current operation.
func BorrowedDataFilePointers ¶ added in v0.7.0
func BorrowedDataFilePointers(file DataFilePointers) ( sortOrderID *int, firstRowID *int64, referencedDataFile *string, contentOffset *int64, contentSizeInBytes *int64, )
BorrowedDataFilePointers returns pointer-valued metadata without copying for the built-in data file and falls back to the public getters for external implementations. The returned pointers must only be dereferenced during the current operation and must not be retained.
func BorrowedDataFileReferencedDataFile ¶ added in v0.7.0
func BorrowedDataFileReferencedDataFile(file DataFileReferencedDataFile) *string
BorrowedDataFileReferencedDataFile returns the optional referenced path without copying for the built-in data file and falls back to the public getter for external implementations. The pointer must only be dereferenced during the current operation and must not be retained.
func BorrowedDataFileStats ¶ added in v0.7.0
func BorrowedDataFileStats(file DataFileStats) ( valueCounts map[int]int64, nullCounts map[int]int64, nanCounts map[int]int64, lowerBounds map[int][]byte, upperBounds map[int][]byte, )
BorrowedDataFileStats returns statistics without copying for the built-in data file and falls back to the public getters for external implementations. The returned values must be treated as read-only and must not escape the current operation.
func BorrowedManifestFilePartitions ¶ added in v0.7.0
func BorrowedManifestFilePartitions[T any](file ManifestFilePartitions[T]) []T
BorrowedManifestFilePartitions returns partition summaries without copying for the built-in manifest file and falls back to the public getter for external implementations. The returned slice and all nested values are read-only borrows that must not escape the current operation.
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 DecodeDefaultBytes ¶ added in v0.7.0
DecodeDefaultBytes decodes the Iceberg hex representation for binary and fixed defaults. Base64 is accepted only for compatibility with metadata written by iceberg-go v0.6.0. Hex wins when both encodings are valid. fixedLen is -1 for binary and the required width for fixed values.
func Difference ¶ added in v0.2.0
Helper function to find the difference between two slices (a - b).
func EncodeDefaultBytes ¶ added in v0.7.0
EncodeDefaultBytes returns the Iceberg JSON single-value representation for binary and fixed defaults.
func FixedNode ¶ added in v0.6.0
func FixedNode(size int) avro.SchemaNode
func FixedSchema ¶ added in v0.6.0
func FloorDiv ¶ added in v0.7.0
func FloorDiv[T constraints.Integer](a, b T) T
FloorDiv performs floored integer division, rounding toward negative infinity. This matches Java's Math.floorDiv behavior for negative dividends.
func MissingRequiredField ¶ added in v0.7.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 BoundPredicateRef ¶ added in v0.7.0
type BoundPredicateRef struct{}
BoundPredicateRef authorizes the zero-copy bound-predicate visitor path for trusted visitors in this module.
type CountingWriter ¶ added in v0.2.0
type DataFileCollections ¶ added in v0.7.0
type DataFileCollectionsRef ¶ added in v0.7.0
type DataFilePartition ¶ added in v0.7.0
DataFilePartition is the public partition surface needed by the internal borrowed-partition helper. It avoids importing the root package here.
type DataFilePartitionRef ¶ added in v0.7.0
type DataFilePartitionRef interface {
DataFilePartitionRef(DataFileRef) map[int]any
}
DataFilePartitionRef is implemented by the built-in data file to expose its immutable partition map to trusted in-module callers.
type DataFilePointers ¶ added in v0.7.0
type DataFilePointers interface {
SortOrderID() *int
FirstRowID() *int64
ReferencedDataFile() *string
ContentOffset() *int64
ContentSizeInBytes() *int64
}
DataFilePointers is the pointer-valued DataFile surface used by internal readers. It avoids importing the root package here.
type DataFilePointersRef ¶ added in v0.7.0
type DataFilePointersRef interface {
DataFilePointersRef(DataFileRef) (
sortOrderID *int,
firstRowID *int64,
referencedDataFile *string,
contentOffset *int64,
contentSizeInBytes *int64,
)
}
DataFilePointersRef is implemented by the built-in data file to expose its pointer-valued fields without allocating defensive copies.
type DataFileRef ¶ added in v0.7.0
type DataFileRef struct{}
DataFileRef authorizes zero-copy access to immutable DataFile state from trusted packages within this module. Go's internal-package rule prevents external callers from constructing this token.
type DataFileReferencedDataFile ¶ added in v0.7.0
type DataFileReferencedDataFile interface {
ReferencedDataFile() *string
}
DataFileReferencedDataFile is the public optional reference surface needed by the internal borrowed-reference helper.
type DataFileReferencedDataFileRef ¶ added in v0.7.0
type DataFileReferencedDataFileRef interface {
DataFileReferencedDataFileRef(DataFileRef) *string
}
DataFileReferencedDataFileRef is implemented by the built-in data file to expose its optional referenced path without allocating a defensive pointer.
type DataFileStats ¶ added in v0.7.0
type DataFileStats interface {
ValueCounts() map[int]int64
NullValueCounts() map[int]int64
NaNValueCounts() map[int]int64
LowerBoundValues() map[int][]byte
UpperBoundValues() map[int][]byte
}
DataFileStats is the public statistics surface needed by the internal borrowed-statistics helper. It is intentionally smaller than iceberg.DataFile so this low-level package does not import the root package.
type DataFileStatsRef ¶ added in v0.7.0
type DataFileStatsRef interface {
DataFileStatsRef(DataFileRef) (
valueCounts map[int]int64,
nullCounts map[int]int64,
nanCounts map[int]int64,
lowerBounds map[int][]byte,
upperBounds map[int][]byte,
)
}
DataFileStatsRef is implemented by the built-in data file to expose its immutable statistics maps to trusted in-module callers.
type ManifestFilePartitions ¶ added in v0.7.0
type ManifestFilePartitions[T any] interface { Partitions() []T }
ManifestFilePartitions is the public partition-summary surface needed by the internal borrowed-partition helper. It is parameterized so this package does not need to import the root package.
type ManifestFileRef ¶ added in v0.7.0
type ManifestFileRef struct{}
ManifestFileRef authorizes zero-copy access to immutable manifest state from trusted packages within this module. Data obtained with this token is borrowed, must be treated as read-only, and must not be retained beyond the current operation. Go's internal-package rule prevents external callers from constructing this token.
type ManifestPartitionBorrower ¶ added in v0.7.0
type ManifestPartitionBorrower[T any] interface { ManifestFilePartitionRef(ManifestFileRef) []T }
ManifestPartitionBorrower is implemented by the built-in manifest file to expose its partition summaries to trusted in-module callers.
type MockFSReadFile ¶
type MockFile ¶
type MockFile struct {
Contents *bytes.Reader
ErrOnClose bool
// contains filtered or unexported fields
}
type PartitionSpecRef ¶ added in v0.7.0
type PartitionSpecRef struct{}
PartitionSpecRef marks partition-spec access that may return references to internal state. It is restricted to packages within this module by Go's internal package rules.
type RequirementWire ¶ added in v0.7.0
type RequirementWire struct {
Type *string `json:"type"`
}
type SchemaRef ¶ added in v0.7.0
type SchemaRef struct{}
SchemaRef marks schema access that may return references to internal state. It is restricted to packages within this module by Go's internal package rules.
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
Source Files
¶
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. |
|
Package scanmetrics instruments client-side scan planning.
|
Package scanmetrics instruments client-side scan planning. |