On this page

    Connecting from Apache Superset or Preset to Dremio Sonar

    You can use Superset or Preset, a cloud service for Superset, to query and visualize data by means of Sonar.

    Supported Versions

    • Superset 1.0 and later
    • Dremio SQLAlchemy connector 3.0.0 and later

    Supported Authentication Method

    Use a personal access token (PAT) obtained from a Sonar project. To obtain one, follow the steps in the section Creating a Token. After you obtain a PAT, you must URL-encode it. To encode it locally on your system, you can follow these steps:

    1. In a browser window, right-click an empty area of the page and select Inspect or Inspect Element, depending on your browser.
    2. In the top bar of the inspection pane, click Console.
    3. Type encodeURIComponent("<PAT>"), where <PAT> is the personal access token that you obtained from Dremio Cloud. The URL-encoded PAT appears in red on the next line. You can highlight it and copy it to your clipboard.

    Prerequisites

    If you installed Superset according to the instructions for installing from scratch, install the Dremio SQLAlchemy Connector on the system or in the VM where Apache Superset is running. Instructions are in the sqlalchemy_dremio repository in GitHub.

    Creating a Connection

    1. Follow either of these steps:

      • If you are using Superset, follow these steps:

        1. Select Data > Databases in the menu bar at the top of the screen.

        2. Click the Database button in the top-right corner of the screen.

        3. In the Connect a Database dialog, select Other from the Supported Databases field.

        4. In the Display Name field, name the new connection.

      • If you are using Preset, follow these steps:

        1. Click the + icon in the top-right corner, and select Data > Connect Database.

        2. Select Dremio from the Supported Databases field of the Connect a Database dialog.

        3. (Optional) In the Display Name field, change Dremio to any name you prefer.

    2. In the SQLALCHEMY URI field, specify a URI that in this format. Use an ampersand in front of each additional parameter that you add:

      URI format
      dremio+flight://data.dremio.cloud:443/<schema>?token=<PAT>&UseEncryption=true&option1=value
      
    3. Test the connection. If the test fails, check the syntax and values in the connection URI.

    4. Click Connect.

    Primary Connection Parameters

    NameTypeDescriptionDefault ValueRequired?
    <schema>stringThe name of the database schema to use by default when a schema is not given in a query. However, this does not prevent queries from being issued for other schemas. Such queries must explicitly include the schema.N/ANo
    tokenstringSpecifies the personal access token (PAT) to use. See Supported Authentication MethodN/AYes

    SSL connection parameters

    Use the following parameters to configure SSL encryption and verification methods:

    NameTypeDescriptionDefault Value
    UseEncryptionintegerForces the client to use an SSL-encrypted connection to communicate with Sonar. Accepted values include:

    true: The client communicates with Sonar only using SSL encryption. This is the only possible value..
    false: The value cannot be false.

    true
    disableCertificateVerificationintegerSpecifies whether the driver should verify the host certificate against the trust store. Accepted values are:

    false: The driver verifies the certificate against the trust store.
    true: The driver does not verify the certificate against the trust store.

    false
    trustedCertsstringThe full path of the .pem file containing certificates trusted by a CA, for the purpose of verifying the server. If this option is not set, then the driver defaults to using the trusted CA certificates .pem file installed by the driver.

    The exact file path varies according to the operating system on which the driver is installed. The path for the Windows driver is different from the path set for the macOS driver.

    The TLS connection fails if you do not specify a value when UseEncryption is true and disableCertificateVerification is false.

    N/A

    Advanced Parameter

    NameTypeDescriptionDefault ValueRequired?
    routing_enginestringThe engine to route queries to while a connection remains open.N/ANo