Skip to content

Commit d032d43

Browse files
committed
chore(pinot-driver): cosmetics polishment of community driver after merge
1 parent 0659c84 commit d032d43

File tree

8 files changed

+36
-67
lines changed

8 files changed

+36
-67
lines changed

docs/pages/product/configuration/data-sources/pinot.mdx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ redirect_from:
55

66
# Pinot
77

8-
Apache Pinot is a real-time distributed OLAP datastore purpose-built for low-latency, high-throughput analytics, and perfect for user-facing analytical workloads
8+
Apache Pinot is a real-time distributed OLAP datastore purpose-built for low-latency, high-throughput analytics,
9+
and perfect for user-facing analytical workloads.
910

1011
## Prerequisites
1112

@@ -28,12 +29,12 @@ CUBEJS_DB_PASS=**********
2829

2930
## Environment Variables
3031

31-
| Environment Variable | Description | Possible Values | Required |
32-
| -------------------------- | ----------------------------------------------------------------------------------- | --------------------------------------------- | :------: |
33-
| `CUBEJS_DB_HOST` | The host URL for your Pinot broker | A valid host URL ||
34-
| `CUBEJS_DB_PORT` | The port for the database connection | A valid port number ||
35-
| `CUBEJS_DB_USER` | The username used to connect to the broker | A valid username ||
36-
| `CUBEJS_DB_PASS` | The password used to connect to the broker | A valid password ||
32+
| Environment Variable | Description | Possible Values | Required |
33+
|----------------------|--------------------------------------------|---------------------|:--------:|
34+
| `CUBEJS_DB_HOST` | The host URL for your Pinot broker | A valid host URL ||
35+
| `CUBEJS_DB_PORT` | The port for the database connection | A valid port number ||
36+
| `CUBEJS_DB_USER` | The username used to connect to the broker | A valid username ||
37+
| `CUBEJS_DB_PASS` | The password used to connect to the broker | A valid password ||
3738

3839
## Pre-Aggregation Feature Support
3940

@@ -55,8 +56,8 @@ here][ref-caching-using-preaggs-build-strats].
5556
</InfoBox>
5657

5758
| Feature | Works with read-only mode? | Is default? |
58-
| ------------- | :------------------------: | :---------: |
59-
| Simple || |
59+
|---------------|:--------------------------:|:-----------:|
60+
| Simple || |
6061
| Batching | - | - |
6162
| Export bucket | - | - |
6263

@@ -77,7 +78,7 @@ Pinot does not support export buckets.
7778

7879
## SSL
7980

80-
Cube does not require any additional configuration to enable SSL as Elasticsearch connections are made over HTTPS.
81+
Cube does not require any additional configuration to enable SSL as Pinot connections are made over HTTPS.
8182

8283
[pinot]: https://docs.pinot.apache.org/
8384
[pinot-docs-approx-agg-fns]:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Change Log
2+

packages/cubejs-pinot-driver/README.md

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,6 @@ Cube.js Pinot driver.
1111

1212
[Learn more](https://github.com/cube-js/cube.js#getting-started)
1313

14-
### Project Status
14+
# License
1515

16-
In Review. [#8689](https://github.com/cube-js/cube/pull/8689)
17-
18-
### Installation
19-
20-
`npm i @inthememory/pinot-driver`
21-
22-
### Usage
23-
#### For Docker
24-
25-
Build development [docker image](https://github.com/cube-js/cube/blob/master/packages/cubejs-docker/DEVELOPMENT.md).
26-
27-
Assuming the built image is tagged `cubejs/cube:dev`
28-
29-
```
30-
FROM cubejs/cube:dev
31-
RUN npm i @inthememory/pinot-driver
32-
```
33-
34-
```
35-
environment:
36-
- CUBEJS_DB_TYPE=pinot
37-
- CUBEJS_DB_HOST= #broker_host
38-
- CUBEJS_DB_PORT= #broker_port
39-
- CUBEJS_DB_USER= #database user
40-
- CUBEJS_DB_PASS= #database password
41-
- CUBEJS_DEV_MODE=true #if running locally
42-
```
43-
44-
### License
45-
46-
Cube.js Pinot Database Driver is [Apache 2.0 licensed](./LICENSE).
16+
Cube.js Pinot Database Driver is [Apache 2.0 licensed](./LICENSE).

packages/cubejs-pinot-driver/package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "@inthememory/pinot-driver",
2+
"name": "@cubejs-backend/pinot-driver",
33
"description": "Cube.js Pinot database driver",
4-
"author": "Julian Ronsse, InTheMemory",
5-
"version": "0.35.80",
4+
"author": "Julian Ronsse, InTheMemory, Cube Dev, Inc.",
5+
"version": "1.1.0",
66
"repository": {
77
"type": "git",
88
"url": "https://github.com/cube-js/cube.git",
9-
"directory": "packages/cubejs-pinotdb-driver"
9+
"directory": "packages/cubejs-pinot-driver"
1010
},
1111
"engines": {
1212
"node": "^14.0.0 || ^16.0.0 || >=17.0.0"
@@ -21,29 +21,29 @@
2121
"build": "rm -rf dist && npm run tsc",
2222
"tsc": "tsc",
2323
"watch": "tsc -w",
24-
"integration": "jest dist/test",
25-
"integration:pinot": "jest dist/test",
24+
"integration": "npm run integration:pinot",
25+
"integration:pinot": "jest --verbose dist/test",
2626
"lint": "eslint src/* --ext .ts",
2727
"lint:fix": "eslint --fix src/* --ext .ts"
2828
},
2929
"dependencies": {
30-
"@cubejs-backend/base-driver": "^0.36.0",
31-
"@cubejs-backend/schema-compiler": "^0.36.0",
32-
"@cubejs-backend/shared": "^0.36.0",
30+
"@cubejs-backend/base-driver": "1.0.3",
31+
"@cubejs-backend/schema-compiler": "1.1.0",
32+
"@cubejs-backend/shared": "1.0.3",
3333
"node-fetch": "^2.6.1",
34-
"ramda": "^0.27.0",
34+
"ramda": "^0.27.2",
3535
"sqlstring": "^2.3.3"
3636
},
3737
"license": "Apache-2.0",
3838
"publishConfig": {
3939
"access": "public"
4040
},
4141
"devDependencies": {
42-
"@cubejs-backend/linter": "^0.36.0",
42+
"@cubejs-backend/linter": "^1.0.0",
4343
"@types/jest": "^27",
4444
"jest": "^27",
4545
"should": "^13.2.3",
46-
"testcontainers": "^10.13.0",
46+
"testcontainers": "^10.10.4",
4747
"typescript": "~5.2.2"
4848
},
4949
"jest": {

packages/cubejs-pinot-driver/pinot-resources/controller.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ controller.data.dir=/var/pinot/controller/data
66
controller.zk.str=zookeeper:2181
77
pinot.set.instance.id.to.hostname=true
88
controller.admin.access.control.principals=admin
9-
controller.admin.access.control.principals.admin.password=mysecret
9+
controller.admin.access.control.principals.admin.password=mysecret

packages/cubejs-pinot-driver/src/PinotDriver.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @copyright Cube Dev, Inc.
33
* @license Apache-2.0
4-
* @fileoverview The `PrestoDriver` and related types declaration.
4+
* @fileoverview The `PinotDriver` and related types declaration.
55
*/
66

77
import {
@@ -146,7 +146,10 @@ export class PinotDriver extends BaseDriver implements DriverInterface {
146146
'Content-Type': 'application/json',
147147
...this.authorizationHeaders()
148148
}),
149-
body: JSON.stringify({ sql: query, queryOptions: `useMultistageEngine=true;timeoutMs=${this.config.queryTimeout}` })
149+
body: JSON.stringify({
150+
sql: query,
151+
queryOptions: `useMultistageEngine=true;timeoutMs=${this.config.queryTimeout}`
152+
})
150153
});
151154

152155
return new Promise((resolve, reject) => {

packages/cubejs-pinot-driver/src/PinotQuery.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ export class PinotQuery extends BaseQuery {
8989
const values = timeDimension.timeSeries().map(
9090
([from, to]) => `select '${from}' f, '${to}' t`
9191
).join(' UNION ALL ');
92-
return `SELECT ${this.timeStampCast('dates.f')} date_from, ${this.timeStampCast('dates.t')} date_to FROM (${values}) AS dates`;
92+
return `SELECT ${this.timeStampCast('dates.f')} date_from, ${this.timeStampCast('dates.t')} date_to
93+
FROM (${values}) AS dates`;
9394
}
9495

9596
public applyMeasureFilters(evaluateSql: '*' | string, symbol: any, cubeName: string) {
@@ -123,14 +124,6 @@ export class PinotQuery extends BaseQuery {
123124
};
124125
}
125126

126-
public hllInit(sql: string) {
127-
return this.countDistinctApprox(sql); // todo: ensure the correct way to do so in pinot
128-
}
129-
130-
public hllMerge(sql: string) {
131-
return this.countDistinctApprox(sql); // todo: ensure the correct way to do so in pinot
132-
}
133-
134127
public countDistinctApprox(sql: string) {
135128
return `DistinctCountHLLPlus(${sql})`;
136129
}

packages/cubejs-server-core/src/core/DriverDependencies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = {
2626
ksql: '@cubejs-backend/ksql-driver',
2727
questdb: '@cubejs-backend/questdb-driver',
2828
materialize: '@cubejs-backend/materialize-driver',
29-
pinot: '@inthememory/pinot-driver',
29+
pinot: '@cubejs-backend/pinot-driver',
3030
// List for JDBC drivers
3131
'databricks-jdbc': '@cubejs-backend/databricks-jdbc-driver',
3232
};

0 commit comments

Comments
 (0)