-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
bugLEGACY. Use the Bug issue type insteadLEGACY. Use the Bug issue type insteadhelp wantedCommunity contributions are welcome.Community contributions are welcome.
Description
Describe the bug
When using Druid adapter, CubeJS is creating invalid SQL queries, which prevents to use CubeJS with Druid DB.
- Repetitive error in console:
When connected to Druid database, in CubeJS backend terminal throws this error every ~30s:
{}
Error: org.apache.calcite.runtime.CalciteContextException: From line 1, column 34 to line 1, column 38: No match found for function signature NOW()
at QueryQueue.parseResult (<CubeJS backend path>/node_modules/@cubejs-backend/query-orchestrator/src/orchestrator/QueryQueue.js:100:13)
at QueryQueue.executeInQueue (<CubeJS backend path>/node_modules/@cubejs-backend/query-orchestrator/src/orchestrator/QueryQueue.js:89:19)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Promise.all (index 0)
at OrchestratorApi.executeQuery (<CubeJS backend path>/node_modules/@cubejs-backend/server-core/src/core/OrchestratorApi.ts:40:20)
at <CubeJS backend path>/node_modules/@cubejs-backend/server-core/src/core/RefreshScheduler.ts:158:9
at async Promise.all (index 0)
at <CubeJS backend path>/node_modules/@cubejs-backend/server-core/src/core/RefreshScheduler.ts:143:7
at async Promise.all (index 1)
Which actually seems to be correct error, cause in Druid there's no such query like NOW() (for current time, there's CURRENT_TIMESTAMP for example)
- Another SQL error is with creating some example chart. In playground, after select Measure > Wikipedia Count, following error is visible:
To Reproduce
Steps to reproduce the behavior:
- Install Apache Druid DB, and load wikipedia example data, as described in https://druid.apache.org/docs/latest/tutorials/index.html
- Install CubeJS for Druid database:
npx cubejs-cli create cubejs -d druid - Set .env file:
CUBEJS_DB_URL="http://localhost:8082"
CUBEJS_DB_USER=""
CUBEJS_DB_PASS=""
npm installnpm run dev- Go to the playground (http://localhost:4000/#/schema), and in "Schema" tab generate Schema:

- Go to "Build" tab
- From "Measures" select "Wikipedia Count"
- Error with invalid query is visible in Playground, and in terminal every ~30s error with
NOW()is visible.
Expected behavior
I should be able to use Druid Database without any errors
Version:
From npm list | grep @cubejs-backend:
├─┬ @cubejs-backend/druid-driver@0.26.16
│ ├─┬ @cubejs-backend/query-orchestrator@0.26.16
│ │ ├── @cubejs-backend/shared@0.26.16 deduped
│ ├─┬ @cubejs-backend/schema-compiler@0.26.16
│ ├─┬ @cubejs-backend/shared@0.26.16
└─┬ @cubejs-backend/server@0.26.16
├── @cubejs-backend/dotenv@9.0.2
├─┬ @cubejs-backend/server-core@0.26.16
│ ├─┬ @cubejs-backend/api-gateway@0.26.16
│ │ ├── @cubejs-backend/shared@0.26.16 deduped
│ ├── @cubejs-backend/query-orchestrator@0.26.16 deduped
│ ├── @cubejs-backend/schema-compiler@0.26.16 deduped
│ ├── @cubejs-backend/shared@0.26.16 deduped
├── @cubejs-backend/shared@0.26.16 deduped
Additional context
OS: macOS Big Sur 11.2.1
Metadata
Metadata
Assignees
Labels
bugLEGACY. Use the Bug issue type insteadLEGACY. Use the Bug issue type insteadhelp wantedCommunity contributions are welcome.Community contributions are welcome.
