cube-js / cube

📊 Cube — Universal semantic layer platform for AI, BI, spreadsheets, and embedded analytics
https://cube.dev
Other
18.02k stars 1.78k forks source link

Refresh key every doesn't work for oracle db #1591

Open polyaha opened 3 years ago

polyaha commented 3 years ago

Describe the bug Im using Cube.js in windows env with oracle db. the connection is up.

To Reproduce

After launching the cube server, (npm run dev) i got

Error querying db: scheduler-c97ed59a-7aed-4951-a832-1cade1474c4c
--
"SELECT 1"
--
{}
Error: ORA-00923: mot-clé FROM absent à l'emplacement prévu ....

Expected behavior

After searching i change the refresh script but i got the same error later with

SELECT FLOOR((((cast (systimestamp at time zone 'UTC' as date) - date '1970-01-01') * 86400)) / 10)

Screenshots If applicable, add screenshots to help explain your problem.

Version: [e.g. 0.4.5]

Additional context

Workaround: I change the script RefreshScheduler.js

      await orchestratorApi.executeQuery({
        ...sqlQuery,
        preAggregations: [],
        query: 'SELECT 1', // TODO get rid off it
        continueWait: true,
        renewQuery: true,
        requestId: context.requestId
      });
    }));
hassankhan commented 3 years ago

Hi @polyaha 👋 Thanks for bringing this to our attention.

Could you update the issue with the version of Cube.js that you're using please?

polyaha commented 3 years ago

Ty for you quick reply, please find below the specs needed :

{
  "name": "ALM_CUBE",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "dev": "node index.js"
  },
  "template": "express",
  "templateVersion": "0.24.5",
  "dependencies": {
    "@cubejs-backend/oracle-driver": "^0.24.5",
    "@cubejs-backend/server": "^0.24.5"
  }
}

You can reproduce the issue by a simple hello world example with oracle db. The only way to test further cube js right know is to change RefreshScheduler.js and with refreshKey:

{
    sql: `SELECT MAX(created_at) FROM ASSET_CORPO`
},

Also after this workaround, the pool is filled and we can get timeout issue.

github-actions[bot] commented 3 years ago

If you are interested in working on this issue, please leave a comment below and we will be happy to assign the issue to you. If this is the first time you are contributing a Pull Request to Cube.js, please check our contribution guidelines. You can also post any questions while contributing in the #contributors channel in the Cube.js Slack.