On this page

    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.

    Syntax
    USE { <path> | { REF | BRANCH | TAG | COMMIT <refValue> } }
       [ IN <catalog_name> ]
    

    Parameters

    <path>

    String

    The path that you want to use.


    USE { REF | BRANCH | TAG | COMMIT } <refValue>

    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 source
    USE Samples."samples.dremio.com"
    
    Use the specified branch as the reference for the current Arctic query session
    USE BRANCH myBranch
    
    Use the specified reference for the current Arctic query session in the specified catalog
    USE BRANCH myBranch
      IN myCatalog