Documentation
¶
Overview ¶
Package deltalog replays a Delta Lake transaction log (JSON commits and checkpoint Parquet files) into the table's active file list and schema (https://github.com/delta-io/delta/blob/master/PROTOCOL.md).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotDeltaTable is returned when the location has no transaction log. ErrNotDeltaTable = errors.New("not a Delta Lake table") // ErrBadLog is returned for a transaction log that cannot be replayed. ErrBadLog = errors.New("invalid Delta Lake transaction log") // ErrUnsupported is returned for protocol features this reader does not implement. ErrUnsupported = errors.New("unsupported Delta Lake feature") )
var ErrBadDeletionVector = errors.New("invalid deletion vector")
ErrBadDeletionVector is returned for a deletion vector that fails validation.
Functions ¶
This section is empty.
Types ¶
type AddFile ¶
type AddFile struct {
PartitionValues map[string]*string
DeletionVector *DeletionVector
Path string
Size int64
}
AddFile is an active data file.
type DeletionVector ¶
type DeletionVector struct {
Offset *int64 `json:"offset"`
StorageType string `json:"storageType"`
PathOrInlineDv string `json:"pathOrInlineDv"`
SizeInBytes int64 `json:"sizeInBytes"`
Cardinality int64 `json:"cardinality"`
}
DeletionVector is the descriptor of a deletion vector on an add action (PROTOCOL.md, "Deletion Vector Descriptor Schema").
func (*DeletionVector) FilePath ¶
func (d *DeletionVector) FilePath() (string, bool, error)
FilePath returns the object a storageType "u" or "p" descriptor lives in: relative to the table root for "u", absolute for "p".
func (*DeletionVector) Inline ¶
func (d *DeletionVector) Inline() ([]byte, error)
Inline returns the serialized bitmap of a storageType "i" descriptor.
func (*DeletionVector) ParseFileDV ¶
func (d *DeletionVector) ParseFileDV(file []byte) (map[int64]bool, error)
ParseFileDV extracts one framed deletion vector (4-byte big-endian size, data, 4-byte big-endian CRC-32) from the bytes of a deletion vector file and returns the deleted row indexes.
func (*DeletionVector) ParseInline ¶
func (d *DeletionVector) ParseInline() (map[int64]bool, error)
ParseInline decodes a storageType "i" descriptor.