USE
The USE
command enables you to specify the context to be used for the current query session. When running Arctic-specific queries, this command enables you to change the reference for the current query session.
USE { <path> | { REF[ERENCE] | BRANCH | TAG | COMMIT <reference_name> } }
[ IN <catalog_name> ]
Parameters
<path> String
The path that you want to use.
USE { REF[ERENCE] | BRANCH | TAG | COMMIT } <reference_name> String
For Arctic-specific queries, you can change the reference for the current SQL session:
REF
: Changes the reference to the specified branch, tag, or commit.BRANCH
: Changes the reference to the specified branch.TAG
: Changes the reference to the specified tag.COMMIT
: Changes the reference to the specified commit. Commit hashes must be enclosed in double quotes (for example,“ff2fe50fef5a030c4fc8e61b252bdc33c72e2b6f929d813833d998b8368302e2”
).
IN <catalog_name> String Optional
The name of the Arctic catalog where you want to change the reference. When this parameter is not used, the current Arctic catalog in the query context is used.
Examples
Use the demo sourceUSE Samples."samples.dremio.com"
USE BRANCH myBranch
USE BRANCH myBranch
IN myCatalog