On this page

    Nessie Commit Context Commands preview

    Each individual state in Nessie is defined by a Nessie commit. Each commit in Nessie has references to its predecessor (the previous versions of the data) except for the first (empty) commit. To learn more about how commits work in Nessie, see Working with data in Nessie.

    To support Nessie commits. you can use the following SQL commands for Nessie:

    • USE: Change the commit reference for your current session.
    • SHOW: Show the available logs and tables in the current Nessie repository.

    note:

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

    Specifying a Branch to Use

    The USE SQL command enables you to change the commit reference for your current SQL session.

    Syntax
    USE ( REF[ERENCE] | BRANCH | TAG | COMMIT ) <refValue>
       [ IN <nessie_name> ]
    

    Parameters

    USE ( REF[ERENCE] | BRANCH | TAG | COMMIT ) <refValue>

    String

    Change the reference point for the current SQL session:

    • REF or REFERENCE: Identifies the branch, tag, or commit that you want to use as the new commit reference point.
    • BRANCH: Changes the commit reference point to the specified branch.
    • TAG: Changes the commit reference point to the specified tag.
    • COMMIT: Changes the commit reference point to the specified commit.
    .


    IN <nessie_name>

    String

    Optional

    The name of the Nessie repository where you want to change the commit reference point. When this parameter is not used, the current Nessie repository is used.

    Showing Logs

    The SHOW LOGS command enables you to show all the logs that are available in a project’s Nessie repository.

    Syntax
    SHOW LOGS
       [ AT ( REF[ERENCE] | BRANCH | TAG | COMMIT ) <refValue> ]
       [ IN <nessie_name> ]
    

    Parameters

    AT ( REF[ERENCE] | BRANCH | TAG | COMMIT ) <refValue>

    String

    Optional

    Specify a reference point where you want to show the logs from. When this parameter is omitted, the current reference point is used.

    • REF or REFERENCE: Identifies the branch, tag, or commit that you want to show the available logs from.
    • BRANCH: Shows the available logs in the specified branch.
    • TAG: Shows the available logs in the specified tag.
    • COMMIT: Shows the available logs in the specified commit.
    .


    IN <nessie_name>

    String

    Optional

    The name of the Nessie repository that you want to show the available logs in. When this parameter is omitted, the current Nessie repository is used.

    Showing Tables

    The SHOW TABLES command enables you to show all the tables that are available in a project’s Nessie repository and within a specific reference point.

    Syntax
    SHOW TABLES
       [ AT ( REF[ERENCE] | BRANCH | TAG | COMMIT ) <refValue> ]
       [ IN <nessie_name> ]
    

    Parameters

    AT ( REF[ERENCE] | BRANCH | TAG | COMMIT ) <refValue>

    String

    Optional

    Specify a reference point where you want to show the available tables from. When this parameter is omitted, the current reference point is used.

    • REF or REFERENCE: Identifies the branch, tag, or commit that you want to show the available tables from.
    • BRANCH: Shows the available tables in the specified branch.
    • TAG: Shows the available tables in the specified tag.
    • COMMIT: Shows the available tables in the specified commit.
    .


    IN <nessie_name>

    String

    Optional

    The name of the Nessie repository that you want to show the available tables in. When this parameter is omitted, the current Nessie repository is used.

    Showing Views

    The SHOW VIEWS command enables you to show all the views that are available in a project’s Nessie repository and within a specific reference point.

    Syntax
    SHOW VIEWS
       [ AT ( REF[ERENCE] | BRANCH | TAG | COMMIT ) <refValue> ]
       [ IN <nessie_name> ]
    

    Parameters

    AT ( REF[ERENCE] | BRANCH | TAG | COMMIT ) <refValue>

    String

    Optional

    Specify a reference point where you want to show the available views from. When this parameter is omitted, the current reference point is used.

    • REF or REFERENCE: Identifies the branch, tag, or commit that you want to show the available views from.
    • BRANCH: Shows the available views in the specified branch.
    • TAG: Shows the available views in the specified tag.
    • COMMIT: Shows the available views in the specified commit.
    .


    IN <nessie_name>

    String

    Optional

    The name of the Nessie repository that you want to show the available views in. When this parameter is omitted, the current Nessie repository is used.