Prestodb / Trino with CubeJS

Hi,

Am trying to connect prestoDB with CubeJS. When I run and try to generate the schema, it shows conenctivity errors. Below are the steps I did:

  • created a cubejs project with DB type as prestodb
  • Updated .env file with Host (with IP like https://10.a.b.c) and port 8081, schema, catalog, user, password

Please help with any reference to connect with prestodb with cubejs. Presto is now Trino and please let me know if there are options to connect to Trino as well.

for presto client config this can be help GitHub - tagomoris/presto-client-node: Distributed query engine Presto client library for node.js
if using customized tls , you must config cube.js PrestoDriver in cube.js using .env not working
current trino not support connect with prestodb client directly.(protocol change). i fork one and do some
change you can test
cube.js with presto

.env

CUBEJS_DB_HOST=<>
CUBEJS_DB_USER=<>
CUBEJS_DB_CATALOG=tpcds
CUBEJS_DB_SCHEMA=sf100000
CUBEJS_DB_USER=<>
CUBEJS_DB_PASS=<>
CUBEJS_WEB_SOCKETS=true
CUBEJS_DEV_MODE=true

cube.js file

const {PrestoDriver} = require("@cubejs-backend/prestodb-driver")
module.exports = {
    driverFactory: ({ dataSource } = {}) => {
        return new PrestoDriver({
            // from presto node client
            ssl: {

            }
        })
    }
};

trino node client link GitHub - rongfengliang/trino-client: Distributed query engine Presto client library for node.js

cube.js trino driver link GitHub - rongfengliang/cubejs-trino-driver: cubejs-trino-driver

you can also using protocol.v1.alternate-header-name=Presto for Client protocol compatiblity

3 Likes

Excellent @rongfengliang ! It worked. I took the latest from the repo. Am able to connect to Trino. Thank you so much for your help!