Skip to main content

Tags Preview

A tag is another type of named references (like branches). Nessie tags are named references to specific commits. Tags always point to the same commit and does not change automatically. As a result, tags are useful to reference specific commits. For example, a tag named web-transactions-in-FY2021 could reference all web transactions completed in the specified year. To learn about how tags work in Nessie, see Tags on the Project Nessie website.

The SQL commands for tags enable you to create reference points for branches and commits. Nessie SQL commands are structured to be consistent with the SQL commands used for other catalog objects and consistent with database standards.

note:

If you are using these SQL commands in engines other than Dremio Sonar, the SQL syntax may differ:

Creating a Tag

When you create a tag, you are providing a tag reference for the current commit.

Syntax
CREATE TAG [ IF NOT EXISTS ] <tag_name> 
[ AT ( REF[ERENCE] | BRANCH | TAG | COMMIT ) <refValue> ]
[ IN <nessie_name> ]

Parameters

{{< sql-section file="data/sql/tags.json" data="creatingATag" >}}

Assigning a Tag

The ASSIGN command enables you to change the reference point that the tag points to.

Syntax
ALTER TAG <tag_name> 
ASSIGN ( REF[ERENCE] | BRANCH | TAG | COMMIT ) <identifier>
[ IN <nessie_name> ]

Parameters

{{< sql-section file="data/sql/tags.json" data="assigningATag" >}}

Showing Tags

Syntax
SHOW TAGS 
[ IN <nessie_name> ]

Parameters

{{< sql-section file="data/sql/tags.json" data="showingTags" >}}

Dropping a Tag

Syntax
DROP TAG [IF EXISTS] <tag_name> 
( AT COMMIT <"commit_hash"> | FORCE )
[ IN <nessie_name> ]

Parameters

{{< sql-section file="data/sql/tags.json" data="droppingATag" >}}