Documentation
¶
Overview ¶
Package fbs holds typed accessors over flatbuf.Table for the tables of the four flatbuffers schemas a Vortex file uses. They are written by hand from the .fbs files at the pinned upstream tag, with the field ids in comments (ids follow declaration order, a union takes two). message.fbs (IPC) is not used by files and is left out.
- vortex-file/flatbuffers/vortex-file/footer.fbs: Postscript, PostscriptSegment, PostscriptMetadata, Footer, ArraySpec, LayoutSpec, SegmentSpec, FileStatistics
- vortex-layout/flatbuffers/vortex-layout/layout.fbs: Layout
- vortex-array/flatbuffers/vortex-array/array.fbs: Array, ArrayNode, Buffer, ArrayStats
- vortex-array/flatbuffers/vortex-dtype/dtype.fbs: DType and its union
None of these schemas uses nested flatbuffers, vectors of unions, shared strings or 64-bit offsets, so internal/flatbuf does not implement them.
Index ¶
- Constants
- type AggregateSet
- type AggregateSpec
- type Array
- type ArrayNode
- func (n ArrayNode) AppendBuffers(dst []uint16) ([]uint16, error)
- func (n ArrayNode) Buffers() ([]uint16, error)
- func (n ArrayNode) Children() (List[ArrayNode], error)
- func (n ArrayNode) Encoding() (uint16, error)
- func (n ArrayNode) Metadata() ([]byte, error)
- func (n ArrayNode) Stats() (ArrayStats, bool, error)
- type ArraySpec
- type ArrayStats
- func (s ArrayStats) IsConstant() (v, ok bool, err error)
- func (s ArrayStats) IsSorted() (v, ok bool, err error)
- func (s ArrayStats) IsStrictSorted() (v, ok bool, err error)
- func (s ArrayStats) Max() ([]byte, bool, error)
- func (s ArrayStats) MaxPrecision() (uint8, error)
- func (s ArrayStats) Min() ([]byte, bool, error)
- func (s ArrayStats) MinPrecision() (uint8, error)
- func (s ArrayStats) NanCount() (v uint64, ok bool, err error)
- func (s ArrayStats) NullCount() (v uint64, ok bool, err error)
- func (s ArrayStats) Sum() ([]byte, bool, error)
- func (s ArrayStats) UncompressedSizeInBytes() (v uint64, ok bool, err error)
- type Buffer
- type DType
- func (d DType) Decimal() (precision uint8, scale int8, err error)
- func (d DType) Extension() (id string, storage DType, metadata []byte, err error)
- func (d DType) FixedSizeList() (DType, uint32, error)
- func (d DType) Kind() (Kind, error)
- func (d DType) List() (DType, error)
- func (d DType) Map() (key, value DType, keysSorted bool, err error)
- func (d DType) Nullable() (bool, error)
- func (d DType) Primitive() (uint8, error)
- func (d DType) Struct() (List[string], List[DType], error)
- func (d DType) Union() (List[string], List[DType], []byte, error)
- type FileStatistics
- func (s FileStatistics) AggregateSets() (List[AggregateSet], error)
- func (s FileStatistics) AggregateSpecs() (List[AggregateSpec], error)
- func (s FileStatistics) EntrySets() ([]uint16, error)
- func (s FileStatistics) FieldStats() (List[ArrayStats], error)
- func (s FileStatistics) Partials() ([]byte, error)
- type Footer
- type Kind
- type Layout
- type LayoutSpec
- type List
- type Postscript
- func (p Postscript) DType() (PostscriptSegment, bool, error)
- func (p Postscript) Footer() (PostscriptSegment, bool, error)
- func (p Postscript) Layout() (PostscriptSegment, bool, error)
- func (p Postscript) Metadata() (List[PostscriptMetadata], error)
- func (p Postscript) Statistics() (PostscriptSegment, bool, error)
- type PostscriptMetadata
- type PostscriptSegment
- type SegmentSpec
Constants ¶
const ( U8 uint8 = iota U16 U32 U64 I8 I16 I32 I64 F16 F32 F64 )
PType values (dtype.fbs, enum PType).
const ( Inexact = 0 Exact = 1 )
Precision of a min or max: 0 Inexact, 1 Exact.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateSet ¶
type AggregateSet struct {
// contains filtered or unexported fields
}
AggregateSet is an ordered list of aggregates recorded together.
func (AggregateSet) Specs ¶
func (a AggregateSet) Specs() ([]uint16, error)
Specs is field 0 (required): indices into AggregateSpecs.
type AggregateSpec ¶
type AggregateSpec struct {
// contains filtered or unexported fields
}
AggregateSpec is an aggregate function and its options.
func (AggregateSpec) Options ¶
func (a AggregateSpec) Options() ([]byte, error)
Options is field 1, the serialized options (absent when empty).
type Array ¶
type Array struct {
// contains filtered or unexported fields
}
Array is the flatbuffer of an array message.
func ReadArray ¶
ReadArray reads the root Array of buf. maxDepth bounds the nesting of the node tree.
type ArrayNode ¶
type ArrayNode struct {
// contains filtered or unexported fields
}
ArrayNode is a node of an array's tree.
func (ArrayNode) AppendBuffers ¶ added in v0.1.1
AppendBuffers appends field 3 to dst.
type ArraySpec ¶
type ArraySpec struct {
// contains filtered or unexported fields
}
ArraySpec names an array encoding.
type ArrayStats ¶
type ArrayStats struct {
// contains filtered or unexported fields
}
ArrayStats holds the statistics of an array. The scalar values are protobuf ScalarValue bytes (see internal/scalar). The optional fields report whether they are set.
func (ArrayStats) IsConstant ¶
func (s ArrayStats) IsConstant() (v, ok bool, err error)
IsConstant is field 7.
func (ArrayStats) IsSorted ¶
func (s ArrayStats) IsSorted() (v, ok bool, err error)
IsSorted is field 5.
func (ArrayStats) IsStrictSorted ¶
func (s ArrayStats) IsStrictSorted() (v, ok bool, err error)
IsStrictSorted is field 6.
func (ArrayStats) MaxPrecision ¶
func (s ArrayStats) MaxPrecision() (uint8, error)
MaxPrecision is field 3.
func (ArrayStats) MinPrecision ¶
func (s ArrayStats) MinPrecision() (uint8, error)
MinPrecision is field 1.
func (ArrayStats) NanCount ¶
func (s ArrayStats) NanCount() (v uint64, ok bool, err error)
NanCount is field 10.
func (ArrayStats) NullCount ¶
func (s ArrayStats) NullCount() (v uint64, ok bool, err error)
NullCount is field 8.
func (ArrayStats) UncompressedSizeInBytes ¶
func (s ArrayStats) UncompressedSizeInBytes() (v uint64, ok bool, err error)
UncompressedSizeInBytes is field 9.
type Buffer ¶
type Buffer struct {
Padding uint16 // bytes written before the buffer
AlignmentExponent uint8
Compression uint8 // 0 None, 1 LZ4
Length uint32
}
Buffer locates a data buffer after the message. It is an 8-byte struct.
type DType ¶
type DType struct {
// contains filtered or unexported fields
}
DType is the table that wraps the union (field 0 is the type, field 1 the value).
func (DType) Extension ¶
Extension returns the id, the storage type and the metadata of an extension type.
func (DType) FixedSizeList ¶
FixedSizeList returns the element type and the size of a fixed-size list type.
func (DType) Map ¶
Map returns the key and value types of a map type, and whether its keys are sorted.
type FileStatistics ¶
type FileStatistics struct {
// contains filtered or unexported fields
}
FileStatistics holds the file-level statistics.
func ReadFileStatistics ¶
func ReadFileStatistics(buf []byte) (FileStatistics, error)
ReadFileStatistics reads the root FileStatistics of buf.
func (FileStatistics) AggregateSets ¶
func (s FileStatistics) AggregateSets() (List[AggregateSet], error)
AggregateSets is field 2.
func (FileStatistics) AggregateSpecs ¶
func (s FileStatistics) AggregateSpecs() (List[AggregateSpec], error)
AggregateSpecs is field 1.
func (FileStatistics) EntrySets ¶
func (s FileStatistics) EntrySets() ([]uint16, error)
EntrySets is field 3, an index into AggregateSets per entry.
func (FileStatistics) FieldStats ¶
func (s FileStatistics) FieldStats() (List[ArrayStats], error)
FieldStats is field 0, one ArrayStats per top-level field (the legacy shape).
func (FileStatistics) Partials ¶
func (s FileStatistics) Partials() ([]byte, error)
Partials is field 4: per entry and spec, a LEB128 length then a ScalarValue.
type Footer ¶
type Footer struct {
// contains filtered or unexported fields
}
Footer is the dictionary of the specs the layout and the arrays refer to by index.
func ReadFooter ¶
ReadFooter reads the root Footer of buf.
func (Footer) ArraySpecs ¶
ArraySpecs is field 0.
func (Footer) LayoutSpecs ¶
func (f Footer) LayoutSpecs() (List[LayoutSpec], error)
LayoutSpecs is field 1.
func (Footer) SegmentSpecs ¶
func (f Footer) SegmentSpecs() (List[SegmentSpec], error)
SegmentSpecs is field 2, a vector of structs.
type Kind ¶
type Kind uint8
Kind is the arm of the DType union (dtype.fbs, enum Type).
const ( KindNull Kind = 1 KindBool Kind = 2 KindPrimitive Kind = 3 KindDecimal Kind = 4 KindUtf8 Kind = 5 KindBinary Kind = 6 KindStruct Kind = 7 KindList Kind = 8 KindExtension Kind = 9 KindFixedSizeList Kind = 10 KindVariant Kind = 11 KindUnion Kind = 12 KindMap Kind = 13 )
The arms of the union. 0 is NONE.
type Layout ¶
type Layout struct {
// contains filtered or unexported fields
}
Layout is a node of the layout tree.
func ReadLayout ¶
ReadLayout reads the root Layout of buf. maxDepth bounds the nesting of the tree.
type LayoutSpec ¶
type LayoutSpec struct {
// contains filtered or unexported fields
}
LayoutSpec names a layout encoding.
type List ¶
type List[T any] struct { // contains filtered or unexported fields }
List is a vector of tables, structs or strings, decoded element by element. It holds the vector and a function with no state for its elements, so that it is a value: reading the children of a node allocates nothing.
type Postscript ¶
type Postscript struct {
// contains filtered or unexported fields
}
Postscript is the table at the end of the file, before the 8-byte trailer.
func ReadPostscript ¶
func ReadPostscript(buf []byte) (Postscript, error)
ReadPostscript reads the root Postscript of buf.
func (Postscript) DType ¶
func (p Postscript) DType() (PostscriptSegment, bool, error)
DType is the segment of the root DType flatbuffer (field 0).
func (Postscript) Footer ¶
func (p Postscript) Footer() (PostscriptSegment, bool, error)
Footer is the segment of the Footer flatbuffer (field 3, required).
func (Postscript) Layout ¶
func (p Postscript) Layout() (PostscriptSegment, bool, error)
Layout is the segment of the root Layout flatbuffer (field 1, required).
func (Postscript) Metadata ¶
func (p Postscript) Metadata() (List[PostscriptMetadata], error)
Metadata lists the user-defined metadata segments (field 4).
func (Postscript) Statistics ¶
func (p Postscript) Statistics() (PostscriptSegment, bool, error)
Statistics is the segment of the FileStatistics flatbuffer (field 2).
type PostscriptMetadata ¶
type PostscriptMetadata struct {
// contains filtered or unexported fields
}
PostscriptMetadata is a keyed user-defined metadata segment.
func (PostscriptMetadata) Key ¶
func (m PostscriptMetadata) Key() (string, error)
Key is field 0 (required).
func (PostscriptMetadata) Segment ¶
func (m PostscriptMetadata) Segment() (PostscriptSegment, bool, error)
Segment is field 1 (required).
type PostscriptSegment ¶
type PostscriptSegment struct {
// contains filtered or unexported fields
}
PostscriptSegment locates a segment, with its compression and encryption inline.
func (PostscriptSegment) AlignmentExponent ¶
func (s PostscriptSegment) AlignmentExponent() (uint8, error)
AlignmentExponent is field 2, the base-2 exponent of the alignment.
func (PostscriptSegment) Compression ¶
func (s PostscriptSegment) Compression() (uint8, error)
Compression is the scheme of the CompressionSpec in field 3: 0 None, 1 LZ4, 2 ZLib, 3 ZStd. It is 0 when the field is absent.
func (PostscriptSegment) Encrypted ¶
func (s PostscriptSegment) Encrypted() bool
Encrypted reports whether the EncryptionSpec of field 4 is present.
func (PostscriptSegment) Length ¶
func (s PostscriptSegment) Length() (uint32, error)
Length is field 1, in bytes.
func (PostscriptSegment) Offset ¶
func (s PostscriptSegment) Offset() (uint64, error)
Offset is field 0, from the start of the file.