Search code examples
kubernetesapache-supersettrino

Add Trino dataset to Apache Superset


I have currently Trino deployed in my Kubernetes cluster using the official Trino(trinodb) Helm Chart. In the same way I deployed Apache superset.

  • Using port forwarding of trino to 8080 and superset to 8088, I am able to access the UI for both from localhost but also I am able to use the trino command line API to query trino using:

    ./trino --server http:localhost:8080

  • I don't have any authentication set

  • mysql is setup correctly as Trino catalog

when I try to add Trino as dataset for Superset using either of the following sqlalchemy URLs:

trino://trino@localhost:8080/mysql
trino://localhost:8080/mysql

When I test the connection from Superset UI, I get the following error:

ERROR: Could not load database driver: TrinoEngineSpec

Please advise how I could solve this issue.


Solution

  • You should install sqlalchemy-trino to make the trino driver available.

    Add these lines to your values.yaml file:

    additionalRequirements:
      - sqlalchemy-trino
    
    bootstrapScript: |
      #!/bin/bash
      pip install sqlalchemy-trino &&\
      if [ ! -f ~/bootstrap ]; then echo "Running Superset with uid {{ .Values.runAsUser }}" > ~/bootstrap; fi
    

    If you want more details about the problem, see this Github issue.

    I added two options that do the same thing because in some versions the additionalRequirements doesn't work and you may need the bootstrapScript option to install the driver.