Commits
Arctic catalogs track the state of your environment using commits. Each individual commit records the state of all objects in the catalog at a point in time. Every change to an object inside the catalog results in a commit. For example:
- Creating objects (e.g., folders, tables, views)
- Updating one or more tables via SQL (e.g.,
INSERT
,UPDATE
,DELETE
,MERGE
,TRUNCATE
) or Spark - Updating a table schema (e.g.,
ALTER TABLE
) or view definition (e.g.,ALTER VIEW
) - Data optimization operations (e.g.,
OPTIMIZE TABLE
) - Deleting objects
Like Git, each commit in your Arctic catalog (except the very first one) has references to its predecessor, and therefore previous versions of the data. This enables you to track changes to your environment, perform time travel on your data, and even roll back to a previous commit if something goes wrong.
Each commit is identified by a commit hash, which is a sequence of hexadecimal characters like 098a092384fa489283498acdfeffba1411287941
.
Viewing Commit History
Every Arctic catalog has a commit log that tracks every commit on the catalog. You can use the commit log to see which actions occurred on your catalog, who performed the action, and when the action occurred. Arctic tracks commits on a per-branch basis, so you can track activity on each branch in your catalog.
To view the commit log for your catalog:
- Select the Sonar project that contains your Arctic catalog.
- In the left hand side of the Datasets page, click on the name of your Arctic catalog.
- On the upper right of your Arctic catalog page, click the History button.
Querying Commits
You can query data at a certain commit by referencing its commit ID as part of your query. For example:
SELECT * FROM GnarlyCatalog.Sales AT COMMIT "098a092384fa489283498acdfeffba1411287941"
To learn more about querying commits, visit the SQL Reference and API Reference.