Connect and query with DBeaver

Important

This feature is currently in preview. The Supplemental Terms of Use for Microsoft Azure Previews include more legal terms that apply to Azure features that are in beta, in preview, or otherwise not yet released into general availability. For information about this specific preview, see Azure HDInsight on AKS preview information. For questions or feature suggestions, please submit a request on AskHDInsight with the details and follow us for more updates on Azure HDInsight Community.

It's possible to use JDBC driver with many available database tools. This article demonstrates how to configure one of the most popular tool DBeaver to connect to Trino cluster with HDInsight on AKS in few simple steps.

Prerequisites

Configure DBeaver to use Trino JDBC driver for HDInsight on AKS

Open DBeaver and from the main menu, select Database -> Driver Manager.

Note

DBeaver comes with existing open-source Trino driver, create a copy of it and register as Trino JDBC driver for HDInsight on AKS.

  1. Select Trino driver from list and click Copy.

    • Update Driver Name, for example, "Azure Trino" or "Trino for HDInsight on AKS" or any other name.
    • Make sure Default Port is 443.

    Screenshot showing Create new Trino driver for HDInsight on AKS.

  2. Select Libraries tab.

  3. Delete all libraries currently registered.

  4. Click Add File and select installed Trino JDBC jar file for HDInsight on AKS from your local disk.

    Note

    Trino CLI for HDInsight on AKS comes with Trino JDBC jar. You can find it in your local disk.
    Reference location example: C:\Program Files (x86)\Microsoft SDKs\Azure\TrinoCli-0.410.0\lib. Location may defer if the installation directory or CLI version is different.

  5. Click Find Class and select io.trino.jdbc.TrinoDriver.

    Screenshot showing Select Trino JDBC driver file.

  6. Click OK and close Driver Manager, the driver is configured to use.

Query and browse Trino cluster with DBeaver

  1. Connect to your Trino cluster by clicking New Database Connection in the toolbar.

  2. Select newly registered driver. In this example, "Azure Trino."

    Screenshot showing Create new connection.

  3. Click "Next." On the Main tab update Host with Trino cluster endpoint, which you can find in portal on cluster overview page.

    Screenshot showing Create new connection main.

  4. Optionally, select Driver properties tab and set azureUseTokenCache=true. This parameter would reduce number of authentication actions user needs to perform if interactive browser authentication is required. DBeaver initializes several connections for different tool windows in UI, each requiring authentication, and possibly user action.

    Screenshot showing Create new connection - properties.

  5. Click OK, connection is ready. You can click Test Connection or close the window.

  6. Expand connection in Database Navigator on the left to browse catalogs. Browser may open with authentication prompt.

  7. In main menu, click SQL Editor -> New SQL Script and type any Trino query to get started.

    Screenshot showing Query Trino in DBeaver.