Snapshot#
Each commit generates a snapshot file, and the version of the snapshot file starts from 1 and must be continuous.
EARLIEST and LATEST are hint files at the beginning and end of the snapshot list, and they can be inaccurate.
When hint files are inaccurate, the reader will scan all snapshot files to determine the beginning and end.
Directory Layout#
warehouse
└── default.db
└── my_table
├── snapshot
├── EARLIEST
├── LATEST
├── snapshot-1
├── snapshot-2
└── snapshot-3
Writing commit will preempt the next snapshot id, and once the snapshot file is successfully written, this commit will become visible.
Snapshot File#
Snapshot file is JSON and includes:
version: Snapshot file version, current is 3.id: Snapshot id, same as the file name.schemaId: The corresponding schema version for this commit.baseManifestList: A manifest list recording all changes from the previous snapshots.deltaManifestList: A manifest list recording all new changes occurred in this snapshot.changelogManifestList: A manifest list recording all changelog produced in this snapshot;nullif no changelog is produced.indexManifest: A manifest recording all index files of this table;nullif no table index file exists.commitUser: Usually generated by UUID; used for recovery of streaming writes—one stream write job with one user.commitIdentifier: Transaction id corresponding to streaming write; each transaction may result in multiple commits for differentcommitKindvalues.commitKind: Type of changes in this snapshot, includingappend,compact,overwriteandanalyze.timeMillis: Commit time in milliseconds.logOffsets: Commit log offsets.totalRecordCount: Record count of all changes occurred in this snapshot.deltaRecordCount: Record count of all new changes occurred in this snapshot.changelogRecordCount: Record count of all changelog produced in this snapshot.watermark: Watermark for input records, from Flink watermark mechanism;Long.MIN_VALUEif there is no watermark.statistics: Stats file name for statistics of this table.