deltalog

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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")
)
View Source
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 Column

type Column struct {
	Name         string
	Type         string
	PhysicalName string
	ID           int
}

Column is one logical table column.

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.

type Snapshot

type Snapshot struct {
	ColumnMapping    string
	Columns          []Column
	PartitionColumns []string
	Files            []AddFile
	Version          int64
}

Snapshot is the table state at a log version.

func Load

func Load(ctx context.Context, st Storage) (*Snapshot, error)

Load replays the log to its newest version.

type Storage

type Storage interface {
	List(ctx context.Context, prefix string) ([]string, error)
	Get(ctx context.Context, key string) ([]byte, error)
}

Storage reads objects under the table location; keys are relative to it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL