Documentation
¶
Index ¶
- Constants
- Variables
- func ExpressionEvaluator(s *Schema, unbound BooleanExpression, caseSensitive bool) (func(StructLike) (bool, error), error)
- func ExtractFieldIDs(expr BooleanExpression) ([]int, error)
- func GeneratePartitionFieldName(schema *Schema, field PartitionField) (string, error)
- func IndexByID(schema *Schema) (map[int]NestedField, error)
- func IndexByName(schema *Schema) (map[string]int, error)
- func IndexNameByID(schema *Schema) (map[int]string, error)
- func IndexParents(schema *Schema) (map[int]int, error)
- func IsMetadataColumn(fieldID int) bool
- func PreOrderVisit[T any](sc *Schema, visitor PreOrderSchemaVisitor[T]) (res T, err error)
- func PropUInt(p Properties, key string, defVal uint) uint
- func SetSchemaCacheSize(size int) error
- func Version() string
- func Visit[T any](sc *Schema, visitor SchemaVisitor[T]) (res T, err error)
- func VisitBoundPredicate[T any](e BoundPredicate, visitor BoundBooleanExprVisitor[T]) T
- func VisitExpr[T any](expr BooleanExpression, visitor BooleanExprVisitor[T]) (res T, err error)
- func VisitMappedFields[S, T any](fields []MappedField, visitor NameMappingVisitor[S, T]) (res S, err error)
- func VisitNameMapping[S, T any](obj NameMapping, visitor NameMappingVisitor[S, T]) (res S, err error)
- func VisitSchemaWithPartner[T, P any](sc *Schema, partner P, visitor SchemaWithPartnerVisitor[T, P], ...) (res T, err error)
- func WriteManifestList(version int, out io.Writer, snapshotID int64, ...) (err error)
- type AboveMaxLiteral
- type AfterFieldVisitor
- type AfterListElementVisitor
- type AfterMapKeyVisitor
- type AfterMapValueVisitor
- type AlwaysFalse
- type AlwaysTrue
- type AndExpr
- type AvroEntryMarshaler
- type BeforeFieldVisitor
- type BeforeListElementVisitor
- type BeforeMapKeyVisitor
- type BeforeMapValueVisitor
- type BelowMinLiteral
- type BinaryLiteral
- func (b BinaryLiteral) Any() any
- func (BinaryLiteral) Comparator() Comparator[[]byte]
- func (b BinaryLiteral) Equals(other Literal) bool
- func (b BinaryLiteral) MarshalBinary() (data []byte, err error)
- func (b BinaryLiteral) String() string
- func (b BinaryLiteral) To(typ Type) (Literal, error)
- func (b BinaryLiteral) Type() Type
- func (b *BinaryLiteral) UnmarshalBinary(data []byte) error
- func (b BinaryLiteral) Value() []byte
- type BinaryType
- type BoolLiteral
- func (b BoolLiteral) Any() any
- func (BoolLiteral) Comparator() Comparator[bool]
- func (b BoolLiteral) Equals(l Literal) bool
- func (b BoolLiteral) MarshalBinary() (data []byte, err error)
- func (b BoolLiteral) String() string
- func (b BoolLiteral) To(t Type) (Literal, error)
- func (b BoolLiteral) Type() Type
- func (b *BoolLiteral) UnmarshalBinary(data []byte) error
- func (b BoolLiteral) Value() bool
- type BooleanExprVisitor
- type BooleanExpression
- func BindExpr(s *Schema, expr BooleanExpression, caseSensitive bool) (BooleanExpression, error)
- func IsIn[T LiteralType](t UnboundTerm, vals ...T) BooleanExpression
- func NewAnd(left, right BooleanExpression, addl ...BooleanExpression) BooleanExpression
- func NewNot(child BooleanExpression) BooleanExpression
- func NewOr(left, right BooleanExpression, addl ...BooleanExpression) BooleanExpression
- func NotIn[T LiteralType](t UnboundTerm, vals ...T) BooleanExpression
- func RewriteNotExpr(expr BooleanExpression) (BooleanExpression, error)
- func SetPredicate(op Operation, t UnboundTerm, lits []Literal) BooleanExpression
- func TranslateColumnNames(expr BooleanExpression, fileSchema *Schema) (BooleanExpression, error)
- type BooleanType
- type BoundBooleanExprVisitor
- type BoundLiteralPredicate
- type BoundPredicate
- type BoundReference
- type BoundSetPredicate
- type BoundTerm
- type BoundTransform
- type BoundUnaryPredicate
- type BucketTransform
- func (t BucketTransform) Apply(value Optional[Literal]) Optional[Literal]
- func (BucketTransform) CanTransform(t Type) bool
- func (t BucketTransform) Equals(other Transform) bool
- func (t BucketTransform) MarshalText() ([]byte, error)
- func (BucketTransform) PreservesOrder() bool
- func (t BucketTransform) Project(name string, pred BoundPredicate) (UnboundPredicate, error)
- func (BucketTransform) ResultType(Type) Type
- func (t BucketTransform) String() string
- func (BucketTransform) ToHumanStr(val any) string
- func (t BucketTransform) Transformer(src Type) func(any) Optional[int32]
- type Comparator
- type DataFile
- type DataFileBuilder
- func (b *DataFileBuilder) BlockSizeInBytes(size int64) *DataFileBuilder
- func (b *DataFileBuilder) Build() DataFile
- func (b *DataFileBuilder) ColumnSizes(sizes map[int]int64) *DataFileBuilder
- func (b *DataFileBuilder) ContentOffset(offset int64) *DataFileBuilder
- func (b *DataFileBuilder) ContentSizeInBytes(size int64) *DataFileBuilder
- func (b *DataFileBuilder) DistinctValueCounts(counts map[int]int64) *DataFileBuilderdeprecated
- func (b *DataFileBuilder) EqualityFieldIDs(ids []int) *DataFileBuilder
- func (b *DataFileBuilder) FirstRowID(id int64) *DataFileBuilder
- func (b *DataFileBuilder) KeyMetadata(key []byte) *DataFileBuilder
- func (b *DataFileBuilder) LowerBoundValues(bounds map[int][]byte) *DataFileBuilder
- func (b *DataFileBuilder) NaNValueCounts(counts map[int]int64) *DataFileBuilder
- func (b *DataFileBuilder) NullValueCounts(counts map[int]int64) *DataFileBuilder
- func (b *DataFileBuilder) ReferencedDataFile(path string) *DataFileBuilder
- func (b *DataFileBuilder) SortOrderID(id int) *DataFileBuilder
- func (b *DataFileBuilder) SplitOffsets(offsets []int64) *DataFileBuilder
- func (b *DataFileBuilder) UpperBoundValues(bounds map[int][]byte) *DataFileBuilder
- func (b *DataFileBuilder) ValueCounts(counts map[int]int64) *DataFileBuilder
- type Date
- type DateLiteral
- func (d DateLiteral) Any() any
- func (DateLiteral) Comparator() Comparator[Date]
- func (d DateLiteral) Decrement() Literal
- func (d DateLiteral) Equals(other Literal) bool
- func (d DateLiteral) Increment() Literal
- func (d DateLiteral) MarshalBinary() (data []byte, err error)
- func (d DateLiteral) String() string
- func (d DateLiteral) To(t Type) (Literal, error)
- func (d DateLiteral) Type() Type
- func (d *DateLiteral) UnmarshalBinary(data []byte) error
- func (d DateLiteral) Value() Date
- type DateType
- type DayTransform
- func (DayTransform) Apply(value Optional[Literal]) (out Optional[Literal])
- func (t DayTransform) CanTransform(sourceType Type) bool
- func (DayTransform) Equals(other Transform) bool
- func (t DayTransform) MarshalText() ([]byte, error)
- func (DayTransform) PreservesOrder() bool
- func (t DayTransform) Project(name string, pred BoundPredicate) (UnboundPredicate, error)
- func (DayTransform) ResultType(Type) Type
- func (DayTransform) String() string
- func (DayTransform) ToHumanStr(val any) string
- func (DayTransform) Transformer(src Type) (func(any) Optional[int32], error)
- type Decimal
- type DecimalLiteral
- func (d DecimalLiteral) Any() any
- func (DecimalLiteral) Comparator() Comparator[Decimal]
- func (d DecimalLiteral) Decrement() Literal
- func (d DecimalLiteral) Equals(other Literal) bool
- func (d DecimalLiteral) Increment() Literal
- func (d DecimalLiteral) MarshalBinary() (data []byte, err error)
- func (d DecimalLiteral) String() string
- func (d DecimalLiteral) To(t Type) (Literal, error)
- func (d DecimalLiteral) Type() Type
- func (d *DecimalLiteral) UnmarshalBinary(data []byte) error
- func (d DecimalLiteral) Value() Decimal
- type DecimalType
- type FieldSummary
- type FileFormat
- type FixedLiteral
- func (f FixedLiteral) Any() any
- func (FixedLiteral) Comparator() Comparator[[]byte]
- func (f FixedLiteral) Equals(other Literal) bool
- func (f FixedLiteral) MarshalBinary() (data []byte, err error)
- func (f FixedLiteral) String() string
- func (f FixedLiteral) To(typ Type) (Literal, error)
- func (f FixedLiteral) Type() Type
- func (f *FixedLiteral) UnmarshalBinary(data []byte) error
- func (f FixedLiteral) Value() []byte
- type FixedType
- type Float32Literal
- func (f Float32Literal) Any() any
- func (Float32Literal) Comparator() Comparator[float32]
- func (f Float32Literal) Equals(other Literal) bool
- func (f Float32Literal) MarshalBinary() (data []byte, err error)
- func (f Float32Literal) String() string
- func (f Float32Literal) To(t Type) (Literal, error)
- func (f Float32Literal) Type() Type
- func (f *Float32Literal) UnmarshalBinary(data []byte) error
- func (f Float32Literal) Value() float32
- type Float32Type
- type Float64Literal
- func (f Float64Literal) Any() any
- func (Float64Literal) Comparator() Comparator[float64]
- func (f Float64Literal) Equals(other Literal) bool
- func (f Float64Literal) MarshalBinary() (data []byte, err error)
- func (f Float64Literal) String() string
- func (f Float64Literal) To(t Type) (Literal, error)
- func (f Float64Literal) Type() Type
- func (f *Float64Literal) UnmarshalBinary(data []byte) error
- func (f Float64Literal) Value() float64
- type Float64Type
- type HourTransform
- func (HourTransform) Apply(value Optional[Literal]) (out Optional[Literal])
- func (t HourTransform) CanTransform(sourceType Type) bool
- func (HourTransform) Equals(other Transform) bool
- func (t HourTransform) MarshalText() ([]byte, error)
- func (HourTransform) PreservesOrder() bool
- func (t HourTransform) Project(name string, pred BoundPredicate) (UnboundPredicate, error)
- func (HourTransform) ResultType(Type) Type
- func (HourTransform) String() string
- func (HourTransform) ToHumanStr(val any) string
- func (HourTransform) Transformer(src Type) (func(any) Optional[int32], error)
- type IdentityTransform
- func (IdentityTransform) Apply(value Optional[Literal]) Optional[Literal]
- func (IdentityTransform) CanTransform(t Type) bool
- func (IdentityTransform) Equals(other Transform) bool
- func (t IdentityTransform) MarshalText() ([]byte, error)
- func (IdentityTransform) PreservesOrder() bool
- func (t IdentityTransform) Project(name string, pred BoundPredicate) (UnboundPredicate, error)
- func (IdentityTransform) ResultType(t Type) Type
- func (IdentityTransform) String() string
- func (IdentityTransform) ToHumanStr(val any) string
- type Int32Literal
- func (i Int32Literal) Any() any
- func (Int32Literal) Comparator() Comparator[int32]
- func (i Int32Literal) Decrement() Literal
- func (i Int32Literal) Equals(other Literal) bool
- func (i Int32Literal) Increment() Literal
- func (i Int32Literal) MarshalBinary() (data []byte, err error)
- func (i Int32Literal) String() string
- func (i Int32Literal) To(t Type) (Literal, error)
- func (i Int32Literal) Type() Type
- func (i *Int32Literal) UnmarshalBinary(data []byte) error
- func (i Int32Literal) Value() int32
- type Int32Type
- type Int64Literal
- func (i Int64Literal) Any() any
- func (Int64Literal) Comparator() Comparator[int64]
- func (i Int64Literal) Decrement() Literal
- func (i Int64Literal) Equals(other Literal) bool
- func (i Int64Literal) Increment() Literal
- func (i Int64Literal) MarshalBinary() (data []byte, err error)
- func (i Int64Literal) String() string
- func (i Int64Literal) To(t Type) (Literal, error)
- func (i Int64Literal) Type() Type
- func (i *Int64Literal) UnmarshalBinary(data []byte) error
- func (i Int64Literal) Value() int64
- type Int64Type
- type ListType
- type Literal
- func Float32AboveMaxLiteral() Literal
- func Float32BelowMinLiteral() Literal
- func Float64AboveMaxLiteral() Literal
- func Float64BelowMinLiteral() Literal
- func Int32AboveMaxLiteral() Literal
- func Int32BelowMinLiteral() Literal
- func Int64AboveMaxLiteral() Literal
- func Int64BelowMinLiteral() Literal
- func LiteralFromBytes(typ Type, data []byte) (Literal, error)
- func NewLiteral[T LiteralType](val T) Literal
- type LiteralType
- type ManifestBuilder
- func (b *ManifestBuilder) AddedFiles(cnt int32) *ManifestBuilder
- func (b *ManifestBuilder) AddedRows(cnt int64) *ManifestBuilder
- func (b *ManifestBuilder) Build() ManifestFile
- func (b *ManifestBuilder) Content(content ManifestContent) *ManifestBuilder
- func (b *ManifestBuilder) DeletedFiles(cnt int32) *ManifestBuilder
- func (b *ManifestBuilder) DeletedRows(cnt int64) *ManifestBuilder
- func (b *ManifestBuilder) ExistingFiles(cnt int32) *ManifestBuilder
- func (b *ManifestBuilder) ExistingRows(cnt int64) *ManifestBuilder
- func (b *ManifestBuilder) KeyMetadata(km []byte) *ManifestBuilder
- func (b *ManifestBuilder) Partitions(p []FieldSummary) *ManifestBuilder
- func (b *ManifestBuilder) SequenceNum(num, minSeqNum int64) *ManifestBuilder
- type ManifestContent
- type ManifestEntry
- type ManifestEntryBuilder
- type ManifestEntryContent
- type ManifestEntryStatus
- type ManifestFile
- type ManifestFileOption
- type ManifestListWriter
- func NewManifestListWriterV1(out io.Writer, snapshotID int64, parentSnapshot *int64) (*ManifestListWriter, error)
- func NewManifestListWriterV2(out io.Writer, snapshotID, sequenceNumber int64, parentSnapshot *int64) (*ManifestListWriter, error)
- func NewManifestListWriterV3(out io.Writer, snapshotId, sequenceNumber, firstRowID int64, ...) (*ManifestListWriter, error)
- type ManifestReader
- func (c *ManifestReader) Close() error
- func (c *ManifestReader) ManifestContent() ManifestContent
- func (c *ManifestReader) PartitionSpec() (*PartitionSpec, error)
- func (c *ManifestReader) PartitionSpecID() (int, error)
- func (c *ManifestReader) ReadEntry() (ManifestEntry, error)
- func (c *ManifestReader) Schema() (*Schema, error)
- func (c *ManifestReader) SchemaID() (int, error)
- func (c *ManifestReader) Version() int
- type ManifestWriter
- func (w *ManifestWriter) Add(entry ManifestEntry) error
- func (w *ManifestWriter) Close() error
- func (w *ManifestWriter) Delete(entry ManifestEntry) error
- func (w *ManifestWriter) Existing(entry ManifestEntry) error
- func (w *ManifestWriter) ToManifestFile(location string, length int64, opts ...ManifestFileOption) (ManifestFile, error)
- type ManifestWriterOption
- type MapType
- func (m *MapType) Equals(other Type) bool
- func (m *MapType) Fields() []NestedField
- func (m *MapType) KeyField() NestedField
- func (m *MapType) MarshalJSON() ([]byte, error)
- func (m *MapType) String() string
- func (*MapType) Type() string
- func (m *MapType) UnmarshalJSON(b []byte) error
- func (m *MapType) ValueField() NestedField
- type MappedField
- type MonthTransform
- func (MonthTransform) Apply(value Optional[Literal]) (out Optional[Literal])
- func (t MonthTransform) CanTransform(sourceType Type) bool
- func (MonthTransform) Equals(other Transform) bool
- func (t MonthTransform) MarshalText() ([]byte, error)
- func (MonthTransform) PreservesOrder() bool
- func (t MonthTransform) Project(name string, pred BoundPredicate) (UnboundPredicate, error)
- func (MonthTransform) ResultType(Type) Type
- func (MonthTransform) String() string
- func (t MonthTransform) ToHumanStr(val any) string
- func (MonthTransform) Transformer(src Type) (func(any) Optional[int32], error)
- type NameMapping
- type NameMappingAccessor
- func (n NameMappingAccessor) FieldPartner(partnerStruct *MappedField, _ int, fieldName string) *MappedField
- func (n NameMappingAccessor) ListElementPartner(partnerList *MappedField) *MappedField
- func (n NameMappingAccessor) MapKeyPartner(partnerMap *MappedField) *MappedField
- func (n NameMappingAccessor) MapValuePartner(partnerMap *MappedField) *MappedField
- func (NameMappingAccessor) SchemaPartner(partner *MappedField) *MappedField
- type NameMappingVisitor
- type NestedField
- type NestedType
- type NotExpr
- type NumericLiteral
- type Operation
- type Optional
- type OrExpr
- type PartitionField
- type PartitionOption
- type PartitionSpec
- func (p *PartitionSpec) BindToSchema(schema *Schema, lastPartitionID *int, newSpecID *int) (PartitionSpec, error)
- func (ps *PartitionSpec) CompatibleWith(other *PartitionSpec) bool
- func (ps PartitionSpec) Equals(other PartitionSpec) bool
- func (ps *PartitionSpec) Field(i int) PartitionField
- func (ps *PartitionSpec) Fields() iter.Seq2[int, PartitionField]
- func (ps *PartitionSpec) FieldsBySourceID(fieldID int) []PartitionField
- func (ps *PartitionSpec) ID() int
- func (ps PartitionSpec) IsUnpartitioned() bool
- func (ps *PartitionSpec) LastAssignedFieldID() int
- func (p *PartitionSpec) Len() int
- func (ps PartitionSpec) MarshalJSON() ([]byte, error)
- func (ps *PartitionSpec) NumFields() int
- func (ps *PartitionSpec) PartitionToPath(data StructLike, sc *Schema) string
- func (ps *PartitionSpec) PartitionType(schema *Schema) *StructType
- func (ps PartitionSpec) String() string
- func (ps *PartitionSpec) UnmarshalJSON(b []byte) error
- type PartnerAccessor
- type PreOrderSchemaVisitor
- type PrimitiveType
- type Properties
- type Reference
- type Schema
- func ApplyNameMapping(schemaWithoutIDs *Schema, nameMapping NameMapping) (*Schema, error)
- func AssignFreshSchemaIDs(sc *Schema, nextID func() int) (*Schema, error)
- func NewSchema(id int, fields ...NestedField) *Schema
- func NewSchemaFromJsonFields(id int, jsonFieldsStr string) (*Schema, error)
- func NewSchemaWithIdentifiers(id int, identifierIDs []int, fields ...NestedField) *Schema
- func PruneColumns(schema *Schema, selected map[int]Void, selectFullTypes bool) (*Schema, error)
- func SanitizeColumnNames(sc *Schema) (*Schema, error)
- func (s *Schema) AsStruct() StructType
- func (s *Schema) Equals(other *Schema) bool
- func (s *Schema) Field(i int) NestedField
- func (s *Schema) FieldHasOptionalParent(id int) bool
- func (s *Schema) FieldIDs() []int
- func (s *Schema) Fields() []NestedField
- func (s *Schema) FindColumnName(fieldID int) (string, bool)
- func (s *Schema) FindFieldByID(id int) (NestedField, bool)
- func (s *Schema) FindFieldByName(name string) (NestedField, bool)
- func (s *Schema) FindFieldByNameCaseInsensitive(name string) (NestedField, bool)
- func (s *Schema) FindTypeByID(id int) (Type, bool)
- func (s *Schema) FindTypeByName(name string) (Type, bool)
- func (s *Schema) FindTypeByNameCaseInsensitive(name string) (Type, bool)
- func (s *Schema) FlatFields() (iter.Seq[NestedField], error)
- func (s *Schema) HighestFieldID() int
- func (s *Schema) MarshalJSON() ([]byte, error)
- func (s *Schema) NameMapping() NameMapping
- func (s *Schema) NumFields() int
- func (s *Schema) Select(caseSensitive bool, names ...string) (*Schema, error)
- func (s *Schema) String() string
- func (s *Schema) Type() string
- func (s *Schema) UnmarshalJSON(b []byte) error
- type SchemaVisitor
- type SchemaVisitorPerPrimitiveType
- type SchemaWithPartnerVisitor
- type Set
- type StringLiteral
- func (s StringLiteral) Any() any
- func (StringLiteral) Comparator() Comparator[string]
- func (s StringLiteral) Equals(other Literal) bool
- func (s StringLiteral) MarshalBinary() (data []byte, err error)
- func (s StringLiteral) String() string
- func (s StringLiteral) To(typ Type) (Literal, error)
- func (s StringLiteral) Type() Type
- func (s *StringLiteral) UnmarshalBinary(data []byte) error
- func (s StringLiteral) Value() string
- type StringType
- type StructLike
- type StructType
- type Term
- type Time
- type TimeLiteral
- func (t TimeLiteral) Any() any
- func (TimeLiteral) Comparator() Comparator[Time]
- func (t TimeLiteral) Equals(other Literal) bool
- func (t TimeLiteral) MarshalBinary() (data []byte, err error)
- func (t TimeLiteral) String() string
- func (t TimeLiteral) To(typ Type) (Literal, error)
- func (t TimeLiteral) Type() Type
- func (t *TimeLiteral) UnmarshalBinary(data []byte) error
- func (t TimeLiteral) Value() Time
- type TimeTransform
- type TimeType
- type Timestamp
- type TimestampLiteral
- func (t TimestampLiteral) Any() any
- func (TimestampLiteral) Comparator() Comparator[Timestamp]
- func (t TimestampLiteral) Decrement() Literal
- func (t TimestampLiteral) Equals(other Literal) bool
- func (t TimestampLiteral) Increment() Literal
- func (t TimestampLiteral) MarshalBinary() (data []byte, err error)
- func (t TimestampLiteral) String() string
- func (t TimestampLiteral) To(typ Type) (Literal, error)
- func (t TimestampLiteral) Type() Type
- func (t *TimestampLiteral) UnmarshalBinary(data []byte) error
- func (t TimestampLiteral) Value() Timestamp
- type TimestampNano
- type TimestampNsLiteral
- func (t TimestampNsLiteral) Any() any
- func (TimestampNsLiteral) Comparator() Comparator[TimestampNano]
- func (t TimestampNsLiteral) Decrement() Literal
- func (t TimestampNsLiteral) Equals(other Literal) bool
- func (t TimestampNsLiteral) Increment() Literal
- func (t TimestampNsLiteral) MarshalBinary() (data []byte, err error)
- func (t TimestampNsLiteral) String() string
- func (t TimestampNsLiteral) To(typ Type) (Literal, error)
- func (t TimestampNsLiteral) Type() Type
- func (t *TimestampNsLiteral) UnmarshalBinary(data []byte) error
- func (t TimestampNsLiteral) Value() TimestampNano
- type TimestampNsType
- type TimestampType
- type TimestampTzNsType
- type TimestampTzType
- type Transform
- type TruncateTransform
- func (t TruncateTransform) Apply(value Optional[Literal]) (out Optional[Literal])
- func (TruncateTransform) CanTransform(t Type) bool
- func (t TruncateTransform) Equals(other Transform) bool
- func (t TruncateTransform) MarshalText() ([]byte, error)
- func (TruncateTransform) PreservesOrder() bool
- func (t TruncateTransform) Project(name string, pred BoundPredicate) (UnboundPredicate, error)
- func (TruncateTransform) ResultType(t Type) Type
- func (t TruncateTransform) String() string
- func (TruncateTransform) ToHumanStr(val any) string
- func (t TruncateTransform) Transformer(src Type) (func(any) any, error)
- type Type
- type TypedLiteral
- type UUIDLiteral
- func (u UUIDLiteral) Any() any
- func (UUIDLiteral) Comparator() Comparator[uuid.UUID]
- func (u UUIDLiteral) Equals(other Literal) bool
- func (u UUIDLiteral) MarshalBinary() (data []byte, err error)
- func (u UUIDLiteral) String() string
- func (u UUIDLiteral) To(typ Type) (Literal, error)
- func (UUIDLiteral) Type() Type
- func (u *UUIDLiteral) UnmarshalBinary(data []byte) error
- func (u UUIDLiteral) Value() uuid.UUID
- type UUIDType
- type UnboundPredicate
- func EqualTo[T LiteralType](t UnboundTerm, v T) UnboundPredicate
- func GreaterThan[T LiteralType](t UnboundTerm, v T) UnboundPredicate
- func GreaterThanEqual[T LiteralType](t UnboundTerm, v T) UnboundPredicate
- func IsNaN(t UnboundTerm) UnboundPredicate
- func IsNull(t UnboundTerm) UnboundPredicate
- func LessThan[T LiteralType](t UnboundTerm, v T) UnboundPredicate
- func LessThanEqual[T LiteralType](t UnboundTerm, v T) UnboundPredicate
- func LiteralPredicate(op Operation, t UnboundTerm, lit Literal) UnboundPredicate
- func NotEqualTo[T LiteralType](t UnboundTerm, v T) UnboundPredicate
- func NotNaN(t UnboundTerm) UnboundPredicate
- func NotNull(t UnboundTerm) UnboundPredicate
- func NotStartsWith(t UnboundTerm, v string) UnboundPredicate
- func StartsWith(t UnboundTerm, v string) UnboundPredicate
- func UnaryPredicate(op Operation, t UnboundTerm) UnboundPredicate
- type UnboundTerm
- type UnknownType
- type VariantLiteral
- func (v VariantLiteral) Any() any
- func (VariantLiteral) Comparator() Comparator[variant.Value]
- func (v VariantLiteral) Equals(other Literal) bool
- func (v VariantLiteral) MarshalBinary() ([]byte, error)
- func (v VariantLiteral) String() string
- func (v VariantLiteral) To(typ Type) (Literal, error)
- func (VariantLiteral) Type() Type
- func (v VariantLiteral) Value() variant.Value
- type VariantType
- type Void
- type VoidTransform
- func (VoidTransform) Apply(value Optional[Literal]) Optional[Literal]
- func (VoidTransform) CanTransform(Type) bool
- func (VoidTransform) Equals(other Transform) bool
- func (t VoidTransform) MarshalText() ([]byte, error)
- func (VoidTransform) PreservesOrder() bool
- func (VoidTransform) Project(string, BoundPredicate) (UnboundPredicate, error)
- func (VoidTransform) ResultType(t Type) Type
- func (VoidTransform) String() string
- func (VoidTransform) ToHumanStr(any) string
- type YearTransform
- func (YearTransform) Apply(value Optional[Literal]) (out Optional[Literal])
- func (t YearTransform) CanTransform(sourceType Type) bool
- func (YearTransform) Equals(other Transform) bool
- func (t YearTransform) MarshalText() ([]byte, error)
- func (YearTransform) PreservesOrder() bool
- func (t YearTransform) Project(name string, pred BoundPredicate) (UnboundPredicate, error)
- func (YearTransform) ResultType(Type) Type
- func (YearTransform) String() string
- func (YearTransform) ToHumanStr(val any) string
- func (YearTransform) Transformer(src Type) (func(any) Optional[int32], error)
Constants ¶
const ( // RowIDFieldID is the field ID for _row_id (optional long). A unique long identifier for every row. RowIDFieldID = 2147483540 // LastUpdatedSequenceNumberFieldID is the field ID for _last_updated_sequence_number (optional long). // The sequence number of the commit that last updated the row. LastUpdatedSequenceNumberFieldID = 2147483539 )
Row lineage metadata column field IDs (v3+). Reserved IDs are Integer.MAX_VALUE - 107 and 108 per the Iceberg spec (Metadata Columns / Row Lineage).
const ( RowIDColumnName = "_row_id" LastUpdatedSequenceNumberColumnName = "_last_updated_sequence_number" )
Row lineage metadata column names (v3+).
const ( PartitionDataIDStart = 1000 InitialPartitionSpecID = 0 )
Variables ¶
var ( ErrInvalidTypeString = errors.New("invalid type") ErrNotImplemented = errors.New("not implemented") ErrInvalidArgument = errors.New("invalid argument") ErrInvalidFormatVersion = fmt.Errorf("%w: invalid format version", ErrInvalidArgument) ErrInvalidSchema = errors.New("invalid schema") ErrInvalidPartitionSpec = errors.New("invalid partition spec") ErrInvalidTransform = errors.New("invalid transform syntax") ErrType = errors.New("type error") ErrBadCast = errors.New("could not cast value") ErrBadLiteral = errors.New("invalid literal value") ErrInvalidBinSerialization = errors.New("invalid binary serialization") ErrResolve = errors.New("cannot resolve type") )
var PositionalDeleteSchema = NewSchema(0, NestedField{ID: 2147483546, Type: PrimitiveTypes.String, Name: "file_path", Required: true}, NestedField{ID: 2147483545, Type: PrimitiveTypes.Int64, Name: "pos", Required: true}, )
var PrimitiveTypes = struct { Bool PrimitiveType Int32 PrimitiveType Int64 PrimitiveType Float32 PrimitiveType Float64 PrimitiveType Date PrimitiveType Time PrimitiveType Timestamp PrimitiveType TimestampTz PrimitiveType TimestampNs PrimitiveType TimestampTzNs PrimitiveType String PrimitiveType Binary PrimitiveType UUID PrimitiveType Unknown PrimitiveType }{ Bool: BooleanType{}, Int32: Int32Type{}, Int64: Int64Type{}, Float32: Float32Type{}, Float64: Float64Type{}, Date: DateType{}, Time: TimeType{}, Timestamp: TimestampType{}, TimestampTz: TimestampTzType{}, TimestampNs: TimestampNsType{}, TimestampTzNs: TimestampTzNsType{}, String: StringType{}, Binary: BinaryType{}, UUID: UUIDType{}, Unknown: UnknownType{}, }
var UnpartitionedSpec = &PartitionSpec{id: 0}
UnpartitionedSpec is the default unpartitioned spec which can be used for comparisons or to just provide a convenience for referencing the same unpartitioned spec object.
Functions ¶
func ExpressionEvaluator ¶
func ExpressionEvaluator(s *Schema, unbound BooleanExpression, caseSensitive bool) (func(StructLike) (bool, error), error)
ExpressionEvaluator returns a function which can be used to evaluate a given expression as long as a structlike value is passed which operates like and matches the passed in schema.
func ExtractFieldIDs ¶
func ExtractFieldIDs(expr BooleanExpression) ([]int, error)
ExtractFieldIDs returns a slice containing the field IDs which are referenced by any terms in the given expression. This enables retrieving exactly which fields are needed for an expression.
func GeneratePartitionFieldName ¶ added in v0.4.0
func GeneratePartitionFieldName(schema *Schema, field PartitionField) (string, error)
GeneratePartitionFieldName returns default partition field name based on field transform type
The default names are aligned with other client implementations https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/BaseUpdatePartitionSpec.java#L518-L563
func IndexByID ¶
func IndexByID(schema *Schema) (map[int]NestedField, error)
IndexByID performs a post-order traversal of the given schema and returns a mapping from field ID to field.
func IndexByName ¶
IndexByName performs a post-order traversal of the schema and returns a mapping from field name to field ID.
func IndexNameByID ¶
IndexNameByID performs a post-order traversal of the schema and returns a mapping from field ID to field name.
func IndexParents ¶
IndexParents generates an index of field IDs to their parent field IDs. Root fields are not indexed
func IsMetadataColumn ¶ added in v0.6.0
IsMetadataColumn returns true if the field ID is a reserved metadata column (e.g. row lineage).
func PreOrderVisit ¶ added in v0.2.0
func PreOrderVisit[T any](sc *Schema, visitor PreOrderSchemaVisitor[T]) (res T, err error)
func PropUInt ¶ added in v0.6.0
func PropUInt(p Properties, key string, defVal uint) uint
PropUInt reads an unsigned-integer property by key. A missing key, an unparseable value, or a negative value returns defVal — PropUInt uses strconv.ParseUint, which rejects negatives rather than silently wrapping them to a large positive number.
func SetSchemaCacheSize ¶ added in v0.6.0
SetSchemaCacheSize resizes the manifest-entry schema cache used by the DataFile codec. The default capacity is sized for a few thousand active partition specs; long-running consumers with larger working sets (e.g. a compaction service touching many tables) should raise it. Existing entries are preserved on grow; on shrink, least-recently used entries are evicted down to the new size. Not safe to call concurrently with codec operations.
func Visit ¶
func Visit[T any](sc *Schema, visitor SchemaVisitor[T]) (res T, err error)
Visit accepts a visitor and performs a post-order traversal of the given schema.
func VisitBoundPredicate ¶
func VisitBoundPredicate[T any](e BoundPredicate, visitor BoundBooleanExprVisitor[T]) T
VisitBoundPredicate uses a BoundBooleanExprVisitor to call the appropriate method based on the type of operation in the predicate. This is a convenience function for implementing the VisitBound method of a BoundBooleanExprVisitor by simply calling iceberg.VisitBoundPredicate(pred, this).
func VisitExpr ¶
func VisitExpr[T any](expr BooleanExpression, visitor BooleanExprVisitor[T]) (res T, err error)
VisitExpr is a convenience function to use a given visitor to visit all parts of a boolean expression in-order. Values returned from the methods are passed to the subsequent methods, effectively "bubbling up" the results.
func VisitMappedFields ¶ added in v0.2.0
func VisitMappedFields[S, T any](fields []MappedField, visitor NameMappingVisitor[S, T]) (res S, err error)
func VisitNameMapping ¶ added in v0.2.0
func VisitNameMapping[S, T any](obj NameMapping, visitor NameMappingVisitor[S, T]) (res S, err error)
func VisitSchemaWithPartner ¶
func VisitSchemaWithPartner[T, P any](sc *Schema, partner P, visitor SchemaWithPartnerVisitor[T, P], accessor PartnerAccessor[P]) (res T, err error)
func WriteManifestList ¶
func WriteManifestList(version int, out io.Writer, snapshotID int64, parentSnapshotID, sequenceNumber *int64, firstRowId int64, files []ManifestFile) (err error)
WriteManifestList writes a list of manifest files to an avro file.
Types ¶
type AboveMaxLiteral ¶
type AboveMaxLiteral interface {
Literal
// contains filtered or unexported methods
}
AboveMaxLiteral represents values that are above the maximum for their type such as values > math.MaxInt32 for an Int32Literal
type AfterFieldVisitor ¶
type AfterFieldVisitor interface {
AfterField(field NestedField)
}
type AfterListElementVisitor ¶
type AfterListElementVisitor interface {
AfterListElement(elem NestedField)
}
type AfterMapKeyVisitor ¶
type AfterMapKeyVisitor interface {
AfterMapKey(key NestedField)
}
type AfterMapValueVisitor ¶
type AfterMapValueVisitor interface {
AfterMapValue(value NestedField)
}
type AlwaysFalse ¶
type AlwaysFalse struct{}
AlwaysFalse is the boolean expression "False"
func (AlwaysFalse) Equals ¶
func (AlwaysFalse) Equals(other BooleanExpression) bool
func (AlwaysFalse) Negate ¶
func (AlwaysFalse) Negate() BooleanExpression
func (AlwaysFalse) Op ¶
func (AlwaysFalse) Op() Operation
func (AlwaysFalse) String ¶
func (AlwaysFalse) String() string
type AlwaysTrue ¶
type AlwaysTrue struct{}
AlwaysTrue is the boolean expression "True"
func (AlwaysTrue) Equals ¶
func (AlwaysTrue) Equals(other BooleanExpression) bool
func (AlwaysTrue) Negate ¶
func (AlwaysTrue) Negate() BooleanExpression
func (AlwaysTrue) Op ¶
func (AlwaysTrue) Op() Operation
func (AlwaysTrue) String ¶
func (AlwaysTrue) String() string
type AndExpr ¶
type AndExpr struct {
// contains filtered or unexported fields
}
func (AndExpr) Equals ¶
func (a AndExpr) Equals(other BooleanExpression) bool
func (AndExpr) Negate ¶
func (a AndExpr) Negate() BooleanExpression
type AvroEntryMarshaler ¶ added in v0.6.0
type AvroEntryMarshaler interface {
MarshalAvroEntry(spec PartitionSpec, schema *Schema, version int) ([]byte, error)
}
AvroEntryMarshaler is implemented by DataFile values that can be encoded using the manifest-entry Avro encoding. The iceberg package's built-in DataFile implementation satisfies it; external implementations can also satisfy it to participate in the github.com/apache/iceberg-go/codec DataFile codec.
The encoded bytes are the same bytes a manifest carries for this data file. Implementations must produce output that the iceberg package's manifest-entry Avro decoder accepts.
type BeforeFieldVisitor ¶
type BeforeFieldVisitor interface {
BeforeField(field NestedField)
}
type BeforeListElementVisitor ¶
type BeforeListElementVisitor interface {
BeforeListElement(elem NestedField)
}
type BeforeMapKeyVisitor ¶
type BeforeMapKeyVisitor interface {
BeforeMapKey(key NestedField)
}
type BeforeMapValueVisitor ¶
type BeforeMapValueVisitor interface {
BeforeMapValue(value NestedField)
}
type BelowMinLiteral ¶
type BelowMinLiteral interface {
Literal
// contains filtered or unexported methods
}
BelowMinLiteral represents values that are below the minimum for their type such as values < math.MinInt32 for an Int32Literal
type BinaryLiteral ¶
type BinaryLiteral []byte
func (BinaryLiteral) Any ¶ added in v0.2.0
func (b BinaryLiteral) Any() any
func (BinaryLiteral) Comparator ¶
func (BinaryLiteral) Comparator() Comparator[[]byte]
func (BinaryLiteral) Equals ¶
func (b BinaryLiteral) Equals(other Literal) bool
func (BinaryLiteral) MarshalBinary ¶
func (b BinaryLiteral) MarshalBinary() (data []byte, err error)
func (BinaryLiteral) String ¶
func (b BinaryLiteral) String() string
func (BinaryLiteral) Type ¶
func (b BinaryLiteral) Type() Type
func (*BinaryLiteral) UnmarshalBinary ¶
func (b *BinaryLiteral) UnmarshalBinary(data []byte) error
func (BinaryLiteral) Value ¶
func (b BinaryLiteral) Value() []byte
type BinaryType ¶
type BinaryType struct{}
func (BinaryType) Equals ¶
func (BinaryType) Equals(other Type) bool
func (BinaryType) String ¶
func (BinaryType) String() string
func (BinaryType) Type ¶
func (BinaryType) Type() string
type BoolLiteral ¶
type BoolLiteral bool
func (BoolLiteral) Any ¶ added in v0.2.0
func (b BoolLiteral) Any() any
func (BoolLiteral) Comparator ¶
func (BoolLiteral) Comparator() Comparator[bool]
func (BoolLiteral) Equals ¶
func (b BoolLiteral) Equals(l Literal) bool
func (BoolLiteral) MarshalBinary ¶
func (b BoolLiteral) MarshalBinary() (data []byte, err error)
func (BoolLiteral) String ¶
func (b BoolLiteral) String() string
func (BoolLiteral) Type ¶
func (b BoolLiteral) Type() Type
func (*BoolLiteral) UnmarshalBinary ¶
func (b *BoolLiteral) UnmarshalBinary(data []byte) error
func (BoolLiteral) Value ¶
func (b BoolLiteral) Value() bool
type BooleanExprVisitor ¶
type BooleanExprVisitor[T any] interface { VisitTrue() T VisitFalse() T VisitNot(childResult T) T VisitAnd(left, right T) T VisitOr(left, right T) T VisitUnbound(UnboundPredicate) T VisitBound(BoundPredicate) T }
BooleanExprVisitor is an interface for recursively visiting the nodes of a boolean expression
type BooleanExpression ¶
type BooleanExpression interface {
fmt.Stringer
Op() Operation
Negate() BooleanExpression
Equals(BooleanExpression) bool
}
BooleanExpression represents a full expression which will evaluate to a boolean value such as GreaterThan or StartsWith, etc.
func BindExpr ¶
func BindExpr(s *Schema, expr BooleanExpression, caseSensitive bool) (BooleanExpression, error)
BindExpr recursively binds each portion of an expression using the provided schema. Because the expression can end up being simplified to just AlwaysTrue/AlwaysFalse, this returns a BooleanExpression.
func IsIn ¶
func IsIn[T LiteralType](t UnboundTerm, vals ...T) BooleanExpression
IsIn is a convenience wrapper for constructing an unbound set predicate for OpIn. It returns a BooleanExpression instead of an UnboundPredicate because depending on the arguments, it can automatically reduce to AlwaysFalse or AlwaysTrue (if given no values for examples). It may also reduce to EqualTo if only one value is provided.
Will panic if t is nil
func NewAnd ¶
func NewAnd(left, right BooleanExpression, addl ...BooleanExpression) BooleanExpression
NewAnd will construct a new AndExpr, allowing the caller to provide potentially more than just two arguments which will be folded to create an appropriate expression tree. i.e. NewAnd(a, b, c, d) becomes AndExpr(a, AndExpr(b, AndExpr(c, d)))
Slight optimizations are performed on creation if either argument is AlwaysFalse or AlwaysTrue by performing reductions. If any argument is AlwaysFalse, then everything will get folded to a return of AlwaysFalse. If an argument is AlwaysTrue, then the other argument will be returned directly rather than creating an AndExpr.
Will panic if any argument is nil
func NewNot ¶
func NewNot(child BooleanExpression) BooleanExpression
NewNot creates a BooleanExpression representing a "Not" operation on the given argument. It will optimize slightly though:
If the argument is AlwaysTrue or AlwaysFalse, the appropriate inverse expression will be returned directly. If the argument is itself a NotExpr, then the child will be returned rather than NotExpr(NotExpr(child)).
func NewOr ¶
func NewOr(left, right BooleanExpression, addl ...BooleanExpression) BooleanExpression
NewOr will construct a new OrExpr, allowing the caller to provide potentially more than just two arguments which will be folded to create an appropriate expression tree. i.e. NewOr(a, b, c, d) becomes OrExpr(a, OrExpr(b, OrExpr(c, d)))
Slight optimizations are performed on creation if either argument is AlwaysFalse or AlwaysTrue by performing reductions. If any argument is AlwaysTrue, then everything will get folded to a return of AlwaysTrue. If an argument is AlwaysFalse, then the other argument will be returned directly rather than creating an OrExpr.
Will panic if any argument is nil
func NotIn ¶
func NotIn[T LiteralType](t UnboundTerm, vals ...T) BooleanExpression
NotIn is a convenience wrapper for constructing an unbound set predicate for OpNotIn. It returns a BooleanExpression instead of an UnboundPredicate because depending on the arguments, it can automatically reduce to AlwaysFalse or AlwaysTrue (if given no values for examples). It may also reduce to NotEqualTo if only one value is provided.
Will panic if t is nil
func RewriteNotExpr ¶
func RewriteNotExpr(expr BooleanExpression) (BooleanExpression, error)
RewriteNotExpr rewrites a boolean expression to remove "Not" nodes from the expression tree. This is because Projections assume there are no "not" nodes.
Not nodes will be replaced with simply calling `Negate` on the child in the tree.
func SetPredicate ¶
func SetPredicate(op Operation, t UnboundTerm, lits []Literal) BooleanExpression
SetPredicate creates a boolean expression representing a predicate that uses a set of literals as the argument, like In or NotIn. Duplicate literals will be folded into a set, only maintaining the unique literals.
Will panic if op is not a valid Set operation
func TranslateColumnNames ¶
func TranslateColumnNames(expr BooleanExpression, fileSchema *Schema) (BooleanExpression, error)
TranslateColumnNames converts the names of columns in an expression by looking up the field IDs in the file schema. If columns don't exist they are replaced with AlwaysFalse or AlwaysTrue depending on the operator.
type BooleanType ¶
type BooleanType struct{}
func (BooleanType) Equals ¶
func (BooleanType) Equals(other Type) bool
func (BooleanType) String ¶
func (BooleanType) String() string
func (BooleanType) Type ¶
func (BooleanType) Type() string
type BoundBooleanExprVisitor ¶
type BoundBooleanExprVisitor[T any] interface { BooleanExprVisitor[T] VisitIn(BoundTerm, Set[Literal]) T VisitNotIn(BoundTerm, Set[Literal]) T VisitIsNan(BoundTerm) T VisitNotNan(BoundTerm) T VisitIsNull(BoundTerm) T VisitNotNull(BoundTerm) T VisitEqual(BoundTerm, Literal) T VisitNotEqual(BoundTerm, Literal) T VisitGreaterEqual(BoundTerm, Literal) T VisitGreater(BoundTerm, Literal) T VisitLessEqual(BoundTerm, Literal) T VisitLess(BoundTerm, Literal) T VisitStartsWith(BoundTerm, Literal) T VisitNotStartsWith(BoundTerm, Literal) T }
BoundBooleanExprVisitor builds on BooleanExprVisitor by adding interface methods for visiting bound expressions, because we do casting of literals during binding you can assume that the BoundTerm and the Literal passed to a method have the same type.
type BoundLiteralPredicate ¶
type BoundLiteralPredicate interface {
BoundPredicate
Literal() Literal
AsUnbound(Reference, Literal) UnboundPredicate
}
BoundLiteralPredicate represents a bound boolean expression that utilizes a single literal as an argument, such as Equals or StartsWith.
type BoundPredicate ¶
type BoundPredicate interface {
BooleanExpression
Ref() BoundReference
Term() BoundTerm
}
BoundPredicate is a boolean predicate expression which has been bound to a schema. The underlying reference and term can be retrieved from it.
type BoundReference ¶
type BoundReference interface {
BoundTerm
Field() NestedField
Pos() int
PosPath() []int
}
BoundReference is a named reference that has been bound to a particular field in a given schema.
type BoundSetPredicate ¶
type BoundSetPredicate interface {
BoundPredicate
Literals() Set[Literal]
AsUnbound(Reference, []Literal) UnboundPredicate
}
BoundSetPredicate is a bound expression that utilizes a set of literals such as In or NotIn
type BoundTerm ¶
type BoundTerm interface {
Term
Equals(BoundTerm) bool
Ref() BoundReference
Type() Type
// contains filtered or unexported methods
}
BoundTerm is a simple expression (typically a reference) that evaluates to a value and has been bound to a schema.
type BoundTransform ¶
type BoundTransform struct {
// contains filtered or unexported fields
}
func (*BoundTransform) Equals ¶
func (b *BoundTransform) Equals(other BoundTerm) bool
func (*BoundTransform) Ref ¶
func (b *BoundTransform) Ref() BoundReference
func (*BoundTransform) String ¶
func (b *BoundTransform) String() string
func (*BoundTransform) Type ¶
func (b *BoundTransform) Type() Type
type BoundUnaryPredicate ¶
type BoundUnaryPredicate interface {
BoundPredicate
AsUnbound(Reference) UnboundPredicate
}
BoundUnaryPredicate is a bound predicate expression that has no arguments
type BucketTransform ¶
type BucketTransform struct {
NumBuckets int
}
BucketTransform transforms values into a bucket partition value. It is parameterized by a number of buckets. Bucket partition transforms use a 32-bit hash of the source value to produce a positive value by mod the bucket number.
func (BucketTransform) Apply ¶
func (t BucketTransform) Apply(value Optional[Literal]) Optional[Literal]
func (BucketTransform) CanTransform ¶ added in v0.4.0
func (BucketTransform) CanTransform(t Type) bool
func (BucketTransform) Equals ¶
func (t BucketTransform) Equals(other Transform) bool
func (BucketTransform) MarshalText ¶
func (t BucketTransform) MarshalText() ([]byte, error)
func (BucketTransform) PreservesOrder ¶ added in v0.2.0
func (BucketTransform) PreservesOrder() bool
func (BucketTransform) Project ¶
func (t BucketTransform) Project(name string, pred BoundPredicate) (UnboundPredicate, error)
func (BucketTransform) ResultType ¶
func (BucketTransform) ResultType(Type) Type
func (BucketTransform) String ¶
func (t BucketTransform) String() string
func (BucketTransform) ToHumanStr ¶ added in v0.2.0
func (BucketTransform) ToHumanStr(val any) string
func (BucketTransform) Transformer ¶
func (t BucketTransform) Transformer(src Type) func(any) Optional[int32]
type Comparator ¶
type Comparator[T LiteralType] func(v1, v2 T) int
Comparator is a comparison function for specific literal types:
returns 0 if v1 == v2 returns <0 if v1 < v2 returns >0 if v1 > v2
type DataFile ¶
type DataFile interface {
// ContentType is the type of the content stored by the data file,
// either Data, Equality deletes, or Position deletes. All v1 files
// are Data files.
ContentType() ManifestEntryContent
// FilePath is the full URI for the file, complete with FS scheme.
FilePath() string
// FileFormat is the format of the data file, AVRO, Orc, or Parquet.
FileFormat() FileFormat
// Partition returns a mapping of field id to partition value for
// each of the partition spec's fields.
Partition() map[int]any
// Count returns the number of records in this file.
Count() int64
// FileSizeBytes is the total file size in bytes.
FileSizeBytes() int64
// ColumnSizes is a mapping from column id to the total size on disk
// of all regions that store the column. Does not include bytes
// necessary to read other columns, like footers. Map will be nil for
// row-oriented formats (avro).
ColumnSizes() map[int]int64
// ValueCounts is a mapping from column id to the number of values
// in the column, including null and NaN values.
ValueCounts() map[int]int64
// NullValueCounts is a mapping from column id to the number of
// null values in the column.
NullValueCounts() map[int]int64
// NaNValueCounts is a mapping from column id to the number of NaN
// values in the column.
NaNValueCounts() map[int]int64
// DistictValueCounts is a mapping from column id to the number of
// distinct values in the column. Distinct counts must be derived
// using values in the file by counting or using sketches, but not
// using methods like merging existing distinct counts.
DistinctValueCounts() map[int]int64
// LowerBoundValues is a mapping from column id to the lower bounded
// value of the column, serialized as binary. Each value in the column
// must be less than or requal to all non-null, non-NaN values in the
// column for the file.
LowerBoundValues() map[int][]byte
// UpperBoundValues is a mapping from column id to the upper bounded
// value of the column, serialized as binary. Each value in the column
// must be greater than or equal to all non-null, non-NaN values in
// the column for the file.
UpperBoundValues() map[int][]byte
// KeyMetadata is implementation-specific key metadata for encryption.
KeyMetadata() []byte
// SplitOffsets are the split offsets for the data file. For example,
// all row group offsets in a Parquet file. Must be sorted ascending.
SplitOffsets() []int64
// EqualityFieldIDs are used to determine row equality in equality
// delete files. It is required when the content type is
// EntryContentEqDeletes.
EqualityFieldIDs() []int
// SortOrderID returns the id representing the sort order for this
// file, or nil if there is no sort order.
SortOrderID() *int
// SpecID returns the partition spec id for this data file, inherited
// from the manifest that the data file was read from
SpecID() int32
// FirstRowID returns the first row ID for this data file ( v3+ only )
FirstRowID() *int64
// ReferencedDataFile returns the location of the data file that deletion vector reference
ReferencedDataFile() *string
// ContentOffset returns the offset in the file where the content starts ( v3+ only )
ContentOffset() *int64
// ContentSizeInBytes returns the length of referenced contented stored in the file (v3+ only)
ContentSizeInBytes() *int64
}
DataFile is the interface for reading the information about a given data file indicated by an entry in a manifest list.
type DataFileBuilder ¶
type DataFileBuilder struct {
// contains filtered or unexported fields
}
DataFileBuilder is a helper for building a data file struct which will conform to the DataFile interface.
func NewDataFileBuilder ¶
func NewDataFileBuilder( spec PartitionSpec, content ManifestEntryContent, path string, format FileFormat, fieldIDToPartitionData map[int]any, fieldIDToLogicalType map[int]string, fieldIDToFixedSize map[int]int, recordCount int64, fileSize int64, ) (*DataFileBuilder, error)
NewDataFileBuilder is passed all of the required fields and then allows all of the optional fields to be set by calling the corresponding methods before calling DataFileBuilder.Build to construct the object.
func (*DataFileBuilder) BlockSizeInBytes ¶
func (b *DataFileBuilder) BlockSizeInBytes(size int64) *DataFileBuilder
BlockSizeInBytes sets the block size in bytes for the data file. Deprecated in v2.
func (*DataFileBuilder) Build ¶
func (b *DataFileBuilder) Build() DataFile
func (*DataFileBuilder) ColumnSizes ¶
func (b *DataFileBuilder) ColumnSizes(sizes map[int]int64) *DataFileBuilder
ColumnSizes sets the column sizes for the data file.
func (*DataFileBuilder) ContentOffset ¶ added in v0.4.0
func (b *DataFileBuilder) ContentOffset(offset int64) *DataFileBuilder
func (*DataFileBuilder) ContentSizeInBytes ¶ added in v0.4.0
func (b *DataFileBuilder) ContentSizeInBytes(size int64) *DataFileBuilder
func (*DataFileBuilder) DistinctValueCounts
deprecated
func (b *DataFileBuilder) DistinctValueCounts(counts map[int]int64) *DataFileBuilder
DistinctValueCounts sets the distinct value counts for the data file.
Deprecated: distinct_counts (field 111) is deprecated in every version of the Iceberg spec (apache/iceberg#12182). The Avro manifest-entry schemas omit the field for v1, v2, and v3, so values set here are not transported in manifests written by this library. The setter is retained for round-tripping legacy DataFiles read from older manifests; new code should not call it.
func (*DataFileBuilder) EqualityFieldIDs ¶
func (b *DataFileBuilder) EqualityFieldIDs(ids []int) *DataFileBuilder
EqualityFieldIDs sets the equality field ids for the data file.
func (*DataFileBuilder) FirstRowID ¶ added in v0.4.0
func (b *DataFileBuilder) FirstRowID(id int64) *DataFileBuilder
func (*DataFileBuilder) KeyMetadata ¶
func (b *DataFileBuilder) KeyMetadata(key []byte) *DataFileBuilder
KeyMetadata sets the key metadata for the data file.
func (*DataFileBuilder) LowerBoundValues ¶
func (b *DataFileBuilder) LowerBoundValues(bounds map[int][]byte) *DataFileBuilder
LowerBoundValues sets the lower bound values for the data file.
func (*DataFileBuilder) NaNValueCounts ¶
func (b *DataFileBuilder) NaNValueCounts(counts map[int]int64) *DataFileBuilder
NaNValueCounts sets the NaN value counts for the data file.
func (*DataFileBuilder) NullValueCounts ¶
func (b *DataFileBuilder) NullValueCounts(counts map[int]int64) *DataFileBuilder
NullValueCounts sets the null value counts for the data file.
func (*DataFileBuilder) ReferencedDataFile ¶ added in v0.4.0
func (b *DataFileBuilder) ReferencedDataFile(path string) *DataFileBuilder
func (*DataFileBuilder) SortOrderID ¶
func (b *DataFileBuilder) SortOrderID(id int) *DataFileBuilder
SortOrderID sets the sort order id for the data file.
func (*DataFileBuilder) SplitOffsets ¶
func (b *DataFileBuilder) SplitOffsets(offsets []int64) *DataFileBuilder
SplitOffsets sets the split offsets for the data file.
func (*DataFileBuilder) UpperBoundValues ¶
func (b *DataFileBuilder) UpperBoundValues(bounds map[int][]byte) *DataFileBuilder
UpperBoundValues sets the upper bound values for the data file.
func (*DataFileBuilder) ValueCounts ¶
func (b *DataFileBuilder) ValueCounts(counts map[int]int64) *DataFileBuilder
ValueCounts sets the value counts for the data file.
type DateLiteral ¶
type DateLiteral Date
func (DateLiteral) Any ¶ added in v0.2.0
func (d DateLiteral) Any() any
func (DateLiteral) Comparator ¶
func (DateLiteral) Comparator() Comparator[Date]
func (DateLiteral) Decrement ¶
func (d DateLiteral) Decrement() Literal
func (DateLiteral) Equals ¶
func (d DateLiteral) Equals(other Literal) bool
func (DateLiteral) Increment ¶
func (d DateLiteral) Increment() Literal
func (DateLiteral) MarshalBinary ¶
func (d DateLiteral) MarshalBinary() (data []byte, err error)
func (DateLiteral) String ¶
func (d DateLiteral) String() string
func (DateLiteral) Type ¶
func (d DateLiteral) Type() Type
func (*DateLiteral) UnmarshalBinary ¶
func (d *DateLiteral) UnmarshalBinary(data []byte) error
func (DateLiteral) Value ¶
func (d DateLiteral) Value() Date
type DateType ¶
type DateType struct{}
DateType represents a calendar date without a timezone or time, represented as a 32-bit integer denoting the number of days since the unix epoch.
type DayTransform ¶
type DayTransform struct{}
DayTransform transforms a datetime value into a date value.
func (DayTransform) Apply ¶
func (DayTransform) Apply(value Optional[Literal]) (out Optional[Literal])
func (DayTransform) CanTransform ¶ added in v0.4.0
func (t DayTransform) CanTransform(sourceType Type) bool
func (DayTransform) Equals ¶
func (DayTransform) Equals(other Transform) bool
func (DayTransform) MarshalText ¶
func (t DayTransform) MarshalText() ([]byte, error)
func (DayTransform) PreservesOrder ¶ added in v0.2.0
func (DayTransform) PreservesOrder() bool
func (DayTransform) Project ¶
func (t DayTransform) Project(name string, pred BoundPredicate) (UnboundPredicate, error)
func (DayTransform) ResultType ¶
func (DayTransform) ResultType(Type) Type
func (DayTransform) String ¶
func (DayTransform) String() string
func (DayTransform) ToHumanStr ¶ added in v0.2.0
func (DayTransform) ToHumanStr(val any) string
func (DayTransform) Transformer ¶
type Decimal ¶
type Decimal struct {
Val decimal.Decimal128
Scale int
}
type DecimalLiteral ¶
type DecimalLiteral Decimal
func (DecimalLiteral) Any ¶ added in v0.2.0
func (d DecimalLiteral) Any() any
func (DecimalLiteral) Comparator ¶
func (DecimalLiteral) Comparator() Comparator[Decimal]
func (DecimalLiteral) Decrement ¶
func (d DecimalLiteral) Decrement() Literal
func (DecimalLiteral) Equals ¶
func (d DecimalLiteral) Equals(other Literal) bool
func (DecimalLiteral) Increment ¶
func (d DecimalLiteral) Increment() Literal
func (DecimalLiteral) MarshalBinary ¶
func (d DecimalLiteral) MarshalBinary() (data []byte, err error)
func (DecimalLiteral) String ¶
func (d DecimalLiteral) String() string
func (DecimalLiteral) Type ¶
func (d DecimalLiteral) Type() Type
func (*DecimalLiteral) UnmarshalBinary ¶
func (d *DecimalLiteral) UnmarshalBinary(data []byte) error
func (DecimalLiteral) Value ¶
func (d DecimalLiteral) Value() Decimal
type DecimalType ¶
type DecimalType struct {
// contains filtered or unexported fields
}
func DecimalTypeOf ¶
func DecimalTypeOf(prec, scale int) DecimalType
func (DecimalType) Equals ¶
func (d DecimalType) Equals(other Type) bool
func (DecimalType) Precision ¶
func (d DecimalType) Precision() int
func (DecimalType) Scale ¶
func (d DecimalType) Scale() int
func (DecimalType) String ¶
func (d DecimalType) String() string
func (DecimalType) Type ¶
func (d DecimalType) Type() string
type FieldSummary ¶
type FileFormat ¶
type FileFormat string
FileFormat defines constants for the format of data files.
const ( AvroFile FileFormat = "AVRO" OrcFile FileFormat = "ORC" ParquetFile FileFormat = "PARQUET" PuffinFile FileFormat = "PUFFIN" )
func FileFormatFromString ¶ added in v0.6.0
func FileFormatFromString(s string) (FileFormat, error)
FileFormatFromString parses a file format string (case-insensitive).
type FixedLiteral ¶
type FixedLiteral []byte
func (FixedLiteral) Any ¶ added in v0.2.0
func (f FixedLiteral) Any() any
func (FixedLiteral) Comparator ¶
func (FixedLiteral) Comparator() Comparator[[]byte]
func (FixedLiteral) Equals ¶
func (f FixedLiteral) Equals(other Literal) bool
func (FixedLiteral) MarshalBinary ¶
func (f FixedLiteral) MarshalBinary() (data []byte, err error)
func (FixedLiteral) String ¶
func (f FixedLiteral) String() string
func (FixedLiteral) Type ¶
func (f FixedLiteral) Type() Type
func (*FixedLiteral) UnmarshalBinary ¶
func (f *FixedLiteral) UnmarshalBinary(data []byte) error
func (FixedLiteral) Value ¶
func (f FixedLiteral) Value() []byte
type FixedType ¶
type FixedType struct {
// contains filtered or unexported fields
}
func FixedTypeOf ¶
type Float32Literal ¶
type Float32Literal float32
func (Float32Literal) Any ¶ added in v0.2.0
func (f Float32Literal) Any() any
func (Float32Literal) Comparator ¶
func (Float32Literal) Comparator() Comparator[float32]
func (Float32Literal) Equals ¶
func (f Float32Literal) Equals(other Literal) bool
func (Float32Literal) MarshalBinary ¶
func (f Float32Literal) MarshalBinary() (data []byte, err error)
func (Float32Literal) String ¶
func (f Float32Literal) String() string
func (Float32Literal) Type ¶
func (f Float32Literal) Type() Type
func (*Float32Literal) UnmarshalBinary ¶
func (f *Float32Literal) UnmarshalBinary(data []byte) error
func (Float32Literal) Value ¶
func (f Float32Literal) Value() float32
type Float32Type ¶
type Float32Type struct{}
Float32Type is the "float" type in the iceberg spec.
func (Float32Type) Equals ¶
func (Float32Type) Equals(other Type) bool
func (Float32Type) String ¶
func (Float32Type) String() string
func (Float32Type) Type ¶
func (Float32Type) Type() string
type Float64Literal ¶
type Float64Literal float64
func (Float64Literal) Any ¶ added in v0.2.0
func (f Float64Literal) Any() any
func (Float64Literal) Comparator ¶
func (Float64Literal) Comparator() Comparator[float64]
func (Float64Literal) Equals ¶
func (f Float64Literal) Equals(other Literal) bool
func (Float64Literal) MarshalBinary ¶
func (f Float64Literal) MarshalBinary() (data []byte, err error)
func (Float64Literal) String ¶
func (f Float64Literal) String() string
func (Float64Literal) Type ¶
func (f Float64Literal) Type() Type
func (*Float64Literal) UnmarshalBinary ¶
func (f *Float64Literal) UnmarshalBinary(data []byte) error
func (Float64Literal) Value ¶
func (f Float64Literal) Value() float64
type Float64Type ¶
type Float64Type struct{}
Float64Type represents the "double" type of the iceberg spec.
func (Float64Type) Equals ¶
func (Float64Type) Equals(other Type) bool
func (Float64Type) String ¶
func (Float64Type) String() string
func (Float64Type) Type ¶
func (Float64Type) Type() string
type HourTransform ¶
type HourTransform struct{}
HourTransform transforms a datetime value into an hour value.
func (HourTransform) Apply ¶
func (HourTransform) Apply(value Optional[Literal]) (out Optional[Literal])
func (HourTransform) CanTransform ¶ added in v0.4.0
func (t HourTransform) CanTransform(sourceType Type) bool
func (HourTransform) Equals ¶
func (HourTransform) Equals(other Transform) bool
func (HourTransform) MarshalText ¶
func (t HourTransform) MarshalText() ([]byte, error)
func (HourTransform) PreservesOrder ¶ added in v0.2.0
func (HourTransform) PreservesOrder() bool
func (HourTransform) Project ¶
func (t HourTransform) Project(name string, pred BoundPredicate) (UnboundPredicate, error)
func (HourTransform) ResultType ¶
func (HourTransform) ResultType(Type) Type
func (HourTransform) String ¶
func (HourTransform) String() string
func (HourTransform) ToHumanStr ¶ added in v0.2.0
func (HourTransform) ToHumanStr(val any) string
func (HourTransform) Transformer ¶
type IdentityTransform ¶
type IdentityTransform struct{}
IdentityTransform uses the identity function, performing no transformation but instead partitioning on the value itself.
func (IdentityTransform) Apply ¶
func (IdentityTransform) Apply(value Optional[Literal]) Optional[Literal]
func (IdentityTransform) CanTransform ¶ added in v0.4.0
func (IdentityTransform) CanTransform(t Type) bool
func (IdentityTransform) Equals ¶
func (IdentityTransform) Equals(other Transform) bool
func (IdentityTransform) MarshalText ¶
func (t IdentityTransform) MarshalText() ([]byte, error)
func (IdentityTransform) PreservesOrder ¶ added in v0.2.0
func (IdentityTransform) PreservesOrder() bool
func (IdentityTransform) Project ¶
func (t IdentityTransform) Project(name string, pred BoundPredicate) (UnboundPredicate, error)
func (IdentityTransform) ResultType ¶
func (IdentityTransform) ResultType(t Type) Type
func (IdentityTransform) String ¶
func (IdentityTransform) String() string
func (IdentityTransform) ToHumanStr ¶ added in v0.2.0
func (IdentityTransform) ToHumanStr(val any) string
type Int32Literal ¶
type Int32Literal int32
func (Int32Literal) Any ¶ added in v0.2.0
func (i Int32Literal) Any() any
func (Int32Literal) Comparator ¶
func (Int32Literal) Comparator() Comparator[int32]
func (Int32Literal) Decrement ¶
func (i Int32Literal) Decrement() Literal
func (Int32Literal) Equals ¶
func (i Int32Literal) Equals(other Literal) bool
func (Int32Literal) Increment ¶
func (i Int32Literal) Increment() Literal
func (Int32Literal) MarshalBinary ¶
func (i Int32Literal) MarshalBinary() (data []byte, err error)
func (Int32Literal) String ¶
func (i Int32Literal) String() string
func (Int32Literal) Type ¶
func (i Int32Literal) Type() Type
func (*Int32Literal) UnmarshalBinary ¶
func (i *Int32Literal) UnmarshalBinary(data []byte) error
func (Int32Literal) Value ¶
func (i Int32Literal) Value() int32
type Int64Literal ¶
type Int64Literal int64
func (Int64Literal) Any ¶ added in v0.2.0
func (i Int64Literal) Any() any
func (Int64Literal) Comparator ¶
func (Int64Literal) Comparator() Comparator[int64]
func (Int64Literal) Decrement ¶
func (i Int64Literal) Decrement() Literal
func (Int64Literal) Equals ¶
func (i Int64Literal) Equals(other Literal) bool
func (Int64Literal) Increment ¶
func (i Int64Literal) Increment() Literal
func (Int64Literal) MarshalBinary ¶
func (i Int64Literal) MarshalBinary() (data []byte, err error)
func (Int64Literal) String ¶
func (i Int64Literal) String() string