cube-js / cube

πŸ“Š Cube β€” The Semantic Layer for Building Data Applications
https://cube.dev
Other
17.95k stars 1.78k forks source link

PrestoDdb-PrestoDriver: Storage schema reading not supported while loading DB schema in Cubejs Playground #4733

Open pandamien opened 2 years ago

pandamien commented 2 years ago

Description

We are running a self hosted Cube Js with Docker-compose. The datasource is a prestodb cluster with a master and 2 workers the presto-server version is 0.26 The error happens right after the connection stage, in the playground it fails to load the database schemas. the connection is fine, and we can create schema manually, which also works fine. seems the error happens in PrestoDriver, specifically in presto-client (node_modules/presto-client/lib/presto-client/index.js:133:13)

could be that the presto-client doesn't support reading schema list, but can only preform requests ?

To Reproduce

the simple getting started setup produce this error Here are the env configurations used for Docker-compose, no custom or specific configurations

CUBEJS_DEV_MODE=true
CUBEJS_API_SECRET=secret
# DB  ENV VARIABLES
CUBEJS_DB_TYPE=prestodb
CUBEJS_DB_HOST=host.docker.internal
CUBEJS_DB_PORT=8080
CUBEJS_DB_USER=prestodb_user
CUBEJS_DB_CATALOG=hive
CUBEJS_DB_SCHEMA=default

Docker-compose

version: '2.2'

services:
  cube:
    restart: always
    image: cubejs/cube:latest
    ports:
      - 4000:4000
    volumes:
      - .:/cube/conf

error message

cube_1  | πŸ¦… Dev environment available at http://localhost:4000
cube_1  | πŸš€ Cube.js server (0.30.10) is listening on 4000
cube_1  | 2022-06-08 06:45:24,937 INFO  [cubestore::mysql] <pid:18> MySQL port open on 0.0.0.0:13306
cube_1  | 2022-06-08 06:45:24,938 INFO  [cubestore::http] <pid:18> Http Server is listening on 0.0.0.0:3030
cube_1  | Performing query: scheduler-072004d8-ee5b-4d75-b722-b9d74712318f
cube_1  | Executing SQL: scheduler-072004d8-ee5b-4d75-b722-b9d74712318f
cube_1  | --
cube_1  |   SELECT FLOOR((UNIX_TIMESTAMP()) / 120) as refresh_key
cube_1  | --
cube_1  | Performing query completed: scheduler-072004d8-ee5b-4d75-b722-b9d74712318f (14ms)
cube_1  | Error: java.lang.UnsupportedOperationException: Storage schema reading not supported
cube_1  | undefined
cube_1  |     at error (/cube/node_modules/@cubejs-backend/prestodb-driver/driver/PrestoDriver.js:61:18)
cube_1  |     at /cube/node_modules/presto-client/lib/presto-client/index.js:334:21
cube_1  |     at IncomingMessage.<anonymous> (/cube/node_modules/presto-client/lib/presto-client/index.js:133:13)
cube_1  |     at IncomingMessage.emit (events.js:412:35)
cube_1  |     at endReadableNT (internal/streams/readable.js:1334:12)
cube_1  |     at processTicksAndRejections (internal/process/task_queues.js:82:21)
ivan-vdovin commented 2 years ago

Hi @pandamien and thanks for posting! Could you confirm user permissions allow to read schema tables?

pandamien commented 2 years ago

Hi @ivan-vdovin , yes the user has permissions to read schema tables. same user is used for superset connection and works fine.