@cubejs-backend/dremio-driver 1.1.16 → 1.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,3 @@
1
- const moment = require('moment-timezone');
2
1
  const { BaseFilter, BaseQuery } = require('@cubejs-backend/schema-compiler');
3
2
 
4
3
  const GRANULARITY_TO_INTERVAL = {
@@ -36,9 +35,15 @@ class DremioQuery extends BaseQuery {
36
35
  return new DremioFilter(this, filter);
37
36
  }
38
37
 
38
+ /**
39
+ * CONVERT_TIMEZONE([sourceTimezone string], destinationTimezone string,
40
+ * timestamp date, timestamp, or string in ISO 8601 format) → timestamp
41
+ * sourceTimezone (optional): The time zone of the timestamp. If you omit this parameter,
42
+ * Dremio assumes that the source time zone is UTC.
43
+ * @see https://docs.dremio.com/cloud/reference/sql/sql-functions/functions/CONVERT_TIMEZONE/
44
+ */
39
45
  convertTz(field) {
40
- const targetTZ = moment().tz(this.timezone).format('Z');
41
- return `CONVERT_TIMEZONE('${targetTZ}', ${field})`;
46
+ return `CONVERT_TIMEZONE('${this.timezone}', ${field})`;
42
47
  }
43
48
 
44
49
  timeStampCast(value) {
@@ -46,7 +51,7 @@ class DremioQuery extends BaseQuery {
46
51
  }
47
52
 
48
53
  timestampFormat() {
49
- return moment.HTML5_FMT.DATETIME_LOCAL_MS;
54
+ return 'YYYY-MM-DDTHH:mm:ss.SSS';
50
55
  }
51
56
 
52
57
  dateTimeCast(value) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@cubejs-backend/dremio-driver",
3
3
  "description": "Cube.js Dremio driver",
4
4
  "author": "Cube Dev, Inc.",
5
- "version": "1.1.16",
5
+ "version": "1.1.17",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/cube-js/cube.git",
@@ -22,16 +22,15 @@
22
22
  "lint:fix": "eslint driver/*.js"
23
23
  },
24
24
  "dependencies": {
25
- "@cubejs-backend/base-driver": "1.1.16",
26
- "@cubejs-backend/schema-compiler": "1.1.16",
27
- "@cubejs-backend/shared": "1.1.12",
25
+ "@cubejs-backend/base-driver": "1.1.17",
26
+ "@cubejs-backend/schema-compiler": "1.1.17",
27
+ "@cubejs-backend/shared": "1.1.17",
28
28
  "axios": "^0.21.1",
29
- "moment-timezone": "^0.5.31",
30
29
  "sqlstring": "^2.3.1"
31
30
  },
32
31
  "devDependencies": {
33
32
  "@cubejs-backend/linter": "^1.0.0",
34
- "@cubejs-backend/testing-shared": "1.1.16",
33
+ "@cubejs-backend/testing-shared": "1.1.17",
35
34
  "jest": "^27"
36
35
  },
37
36
  "license": "Apache-2.0",
@@ -47,5 +46,5 @@
47
46
  "eslintConfig": {
48
47
  "extends": "../cubejs-linter"
49
48
  },
50
- "gitHead": "924a17cf930acd7ecbe4d50105e724bf17d3881a"
49
+ "gitHead": "d130dbc32b2931ecd1264d44fd8952e6d8f52c94"
51
50
  }
@@ -63,7 +63,7 @@ cube(\`sales\`, {
63
63
  const queryAndParams = query.buildSqlAndParams();
64
64
 
65
65
  expect(queryAndParams[0]).toContain(
66
- 'DATE_TRUNC(\'day\', CONVERT_TIMEZONE(\'-08:00\', "sales".sales_datetime))'
66
+ 'DATE_TRUNC(\'day\', CONVERT_TIMEZONE(\'America/Los_Angeles\', "sales".sales_datetime))'
67
67
  );
68
68
  }));
69
69