Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
b50082a
feat(vertica-driver): VerticaDriver
korowa Aug 14, 2022
2a5aebb
Merge remote-tracking branch 'upstream/master' into vertica_driver
korowa Oct 2, 2022
f5ecb77
fixed linter error
korowa Oct 2, 2022
5fbbb1a
Merge remote-tracking branch 'upstream/master' into vertica_driver
korowa Oct 4, 2022
ccdd87a
Merge remote-tracking branch 'upstream/master' into vertica_driver
korowa Oct 10, 2022
098f884
fix dependencies versions
korowa Oct 10, 2022
6818253
driver & smoke tests
korowa Oct 13, 2022
3b463b7
Merge remote-tracking branch 'upstream/master' into vertica_driver
korowa Oct 13, 2022
9d6f43f
vertica driver added to integration tests
korowa Oct 13, 2022
40270a4
Merge branch 'master' into vertica_driver
timbrownls20 Oct 10, 2023
2eb00eb
add vertica to smoke test
timbrownls20 Oct 10, 2023
1d1aa6b
update packages
timbrownls20 Oct 17, 2023
004e119
vertica driver published
timbrownls20 Oct 20, 2023
7770def
vertica driver
timbrownls20 Oct 20, 2023
0fe9da8
Merge branch 'master' into vertica_driver
timbrownls20 Oct 24, 2023
3daaf38
update README.md
timbrownls20 Oct 26, 2023
abd02a7
docker installation instruction
timbrownls20 Oct 26, 2023
63fe819
up version
timbrownls20 Oct 26, 2023
ea68485
Merge branch 'master' into vertica_driver
timbrownls20 Oct 26, 2023
3c5d99f
Merge branch 'master' into vertica_driver
timbrownls20 Oct 30, 2023
9b1f837
update README and package refs
timbrownls20 Oct 30, 2023
b25bf29
add cube build pipeline
Dec 1, 2023
f371f44
remove
Dec 1, 2023
76fcb77
Merge branch 'master' of https://github.com/cube-js/cube
timbrownls20 Mar 18, 2024
ea8a390
Merge branch 'vertica_driver' into update-from-cubejs
timbrownls20 Mar 18, 2024
401d379
Merge pull request #4 from KnowItAllAus/update-from-cubejs
timbrownls20 Mar 18, 2024
92f23e6
Added Query Implementation (#2)
enhanse Mar 20, 2024
033c401
Sql fixes (#5)
enhanse Mar 20, 2024
04334c0
Additional sql fixes (#6)
enhanse Mar 21, 2024
416feed
draft
enhanse Mar 26, 2024
b2cedcb
Merge branch 'master' of https://github.com/cube-js/cube into update-…
timbrownls20 Sep 16, 2024
6f428a0
Merge pull request #8 from KnowItAllAus/update-from-cubejs
timbrownls20 Sep 16, 2024
2c81b0d
Merge branch 'vertica_driver' into update-vertica-driver
timbrownls20 Sep 16, 2024
8672648
Merge pull request #9 from KnowItAllAus/update-vertica-driver
timbrownls20 Sep 16, 2024
8363c3c
update test
timbrownls20 Sep 16, 2024
79067f1
Merge branch 'vertica_driver' into fix/default-connection-pool-to-utc
timbrownls20 Sep 16, 2024
0bab644
Merge pull request #7 from KnowItAllAus/fix/default-connection-pool-t…
timbrownls20 Sep 16, 2024
dfbbd82
fix build
timbrownls20 Sep 16, 2024
f9312cf
update vertica driver dependencies
timbrownls20 Sep 17, 2024
7a4bdd5
Merge branch 'master' into vertica_driver
timbrownls20 Sep 17, 2024
6057a0c
Merge tag 'v0.36.5'
timbrownls20 Oct 8, 2024
86a48a2
Merge branch 'master' into vertica_driver
timbrownls20 Oct 8, 2024
ce8aba5
Merge branch 'master' into vertica_driver
timbrownls20 Oct 8, 2024
52d1814
Merge branch 'master' into vertica_driver
timbrownls20 Oct 16, 2024
7def0f3
Merge branch 'master' into vertica_driver
timbrownls20 Oct 23, 2024
5a6194c
Merge branch 'master' into vertica_driver
timbrownls20 Oct 24, 2024
17fa568
vertica documentation
timbrownls20 Nov 19, 2024
8dd1c8a
add vertica to data sources
timbrownls20 Nov 19, 2024
2790967
fix lint errors
timbrownls20 Nov 19, 2024
79b3ca0
Merge branch 'master' into vertica_driver
timbrownls20 Nov 19, 2024
7fa80a6
Merge branch 'master' into vertica_driver
timbrownls20 Dec 2, 2024
786f846
Merge branch 'master' into vertica_driver
timbrownls20 Dec 3, 2024
adcde01
update jest
timbrownls20 Dec 6, 2024
2161a47
Merge branch 'vertica_driver' of https://github.com/KnowItAllAus/cube…
timbrownls20 Dec 6, 2024
fa025e8
include vertica tests
timbrownls20 Dec 6, 2024
b51e6ae
Merge branch 'master' into vertica_driver
timbrownls20 Dec 6, 2024
a88cac3
update wait strategy and test shared package
timbrownls20 Dec 10, 2024
527f3f1
Merge branch 'master' into vertica_driver
timbrownls20 Dec 10, 2024
78a2119
change version of vertica driver
timbrownls20 Dec 11, 2024
e1aa6e9
Merge branch 'master' into vertica_driver
timbrownls20 Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/actions/integration/vertica.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -eo pipefail

# Debug log for test containers
export DEBUG=testcontainers

export TEST_VERTICA_VERSION=11.1.1-0

echo "::group::Vertica ${TEST_VERTICA_VERSION}"
docker pull vertica/vertica-ce:${TEST_VERTICA_VERSION}
yarn lerna run --concurrency 1 --stream --no-prefix integration:vertica
echo "::endgroup::"
4 changes: 4 additions & 0 deletions .github/actions/smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ echo "::group::MongoBI"
yarn lerna run --concurrency 1 --stream --no-prefix smoke:mongobi
echo "::endgroup::"

echo "::group::Vertica"
yarn lerna run --concurrency 1 --stream --no-prefix smoke:vertica
echo "::endgroup::"

echo "::group::RBAC"
yarn lerna run --concurrency 1 --stream --no-prefix smoke:rbac
echo "::endgroup::"
5 changes: 4 additions & 1 deletion .github/workflows/drivers-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ on:
- 'packages/cubejs-mysql-driver/**'
- 'packages/cubejs-postgres-driver/**'
- 'packages/cubejs-snowflake-driver/**'
- 'packages/cubejs-vertica-driver/**'

# To test SQL API Push down
- 'packages/cubejs-backend-native/**'
Expand All @@ -49,7 +50,8 @@ on:
- 'packages/cubejs-mysql-driver/**'
- 'packages/cubejs-postgres-driver/**'
- 'packages/cubejs-snowflake-driver/**'

- 'packages/cubejs-vertica-driver/**'

# To test SQL API Push down
- 'packages/cubejs-backend-native/**'
- 'rust/cubesql/**'
Expand Down Expand Up @@ -203,6 +205,7 @@ jobs:
snowflake-export-bucket-azure
snowflake-export-bucket-azure-via-storage-integration
snowflake-export-bucket-gcs
vertica
# As per docs:
# Secrets cannot be directly referenced in if: conditionals. Instead, consider setting
# secrets as job-level environment variables, then referencing the environment variables
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ jobs:
node-version: [20.x]
db: [
'clickhouse', 'druid', 'elasticsearch', 'mssql', 'mysql', 'postgres', 'prestodb',
'mysql-aurora-serverless', 'crate', 'mongobi', 'firebolt'
'mysql-aurora-serverless', 'crate', 'mongobi', 'firebolt', 'vertica'
]
fail-fast: false

Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
5 changes: 5 additions & 0 deletions docs/pages/product/configuration/data-sources.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ sources][ref-config-multi-data-src] out of the box.
imageUrl="https://static.cube.dev/icons/firebolt.svg"
title="Firebolt"
/>
<GridItem
url="data-sources/vertica"
imageUrl="https://static.cube.dev/icons/vertica.svg"
title="Vertica"
/>
</Grid>

## Query engines
Expand Down
46 changes: 46 additions & 0 deletions docs/pages/product/configuration/data-sources/vertica.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Vertica

## Prerequisites

- The hostname for the [Vertica][vertica] database server
- The username/password for the [Vertica][vertica] database server
- The name of the database to use within the [Vertica][vertica] database server

## Setup

### Manual

Add the following to a `.env` file in your Cube project:

```dotenv
CUBEJS_DB_TYPE=vertica
CUBEJS_DB_HOST=my.vertica.host
CUBEJS_DB_USER=vertica_user
CUBEJS_DB_PASS=**********
CUBEJS_DB_SCHEMA=my_vertica_schema
```

## Environment Variables

| Environment Variable | Description | Possible Values | Required |
| -------------------------- | ----------------------------------------------------------------------------------- | --------------------------------------------- | :------: |
| `CUBEJS_DB_HOST` | The host URL for a database | A valid database host URL | ✅ |
| `CUBEJS_DB_PORT` | The port for the database connection | A valid port number | ❌ |
| `CUBEJS_DB_USER` | The username used to connect to the database | A valid database username | ✅ |
| `CUBEJS_DB_PASS` | The password used to connect to the database | A valid database password | ✅ |
| `CUBEJS_DB_SCHEMA` | The schema within the database to connect to | A valid schema name within a Presto database | ✅ |
| `CUBEJS_DB_SSL` | If `true`, enables SSL encryption for database connections from Cube | `true`, `false` | ❌ |
| `CUBEJS_CONCURRENCY` | The number of concurrent connections each queue has to the database. Default is `2` | A valid number | ❌ |
| `CUBEJS_DB_MAX_POOL` | The maximum number of concurrent database connections to pool. Default is `8` | A valid number | ❌ |


## SSL

To enable SSL-encrypted connections between Cube and Verica, set the
`CUBEJS_DB_SSL` environment variable to `true`. For more information on how to
configure custom certificates, please check out [Enable SSL Connections to the
Database][ref-recipe-enable-ssl].

[vertica]: https://www.vertica.com/documentation/vertica/all/
[ref-recipe-enable-ssl]:/guides/recipes/data-sources/using-ssl-connections-to-data-source

2 changes: 2 additions & 0 deletions packages/cubejs-docker/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ COPY packages/cubejs-sqlite-driver/package.json packages/cubejs-sqlite-driver/pa
COPY packages/cubejs-ksql-driver/package.json packages/cubejs-ksql-driver/package.json
COPY packages/cubejs-dbt-schema-extension/package.json packages/cubejs-dbt-schema-extension/package.json
COPY packages/cubejs-jdbc-driver/package.json packages/cubejs-jdbc-driver/package.json
COPY packages/cubejs-vertica-driver/package.json packages/cubejs-vertica-driver/package.json
# Skip
# COPY packages/cubejs-testing/package.json packages/cubejs-testing/package.json
# COPY packages/cubejs-docker/package.json packages/cubejs-docker/package.json
Expand Down Expand Up @@ -150,6 +151,7 @@ COPY packages/cubejs-ksql-driver/ packages/cubejs-ksql-driver/
COPY packages/cubejs-dbt-schema-extension/ packages/cubejs-dbt-schema-extension/
COPY packages/cubejs-jdbc-driver/ packages/cubejs-jdbc-driver/
COPY packages/cubejs-databricks-jdbc-driver/ packages/cubejs-databricks-jdbc-driver/
COPY packages/cubejs-vertica-driver/ packages/cubejs-vertica-driver/
# Skip
# COPY packages/cubejs-testing/ packages/cubejs-testing/
# COPY packages/cubejs-docker/ packages/cubejs-docker/
Expand Down
1 change: 1 addition & 0 deletions packages/cubejs-docker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@cubejs-backend/snowflake-driver": "1.1.8",
"@cubejs-backend/sqlite-driver": "1.1.8",
"@cubejs-backend/trino-driver": "1.1.9",
"@knowitall/vertica-driver": "^0.32.4",
"cubejs-cli": "1.1.9",
"typescript": "~5.2.2"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module.exports = {
ksql: '@cubejs-backend/ksql-driver',
questdb: '@cubejs-backend/questdb-driver',
materialize: '@cubejs-backend/materialize-driver',
vertica: '@knowitall/vertica-driver',
pinot: '@cubejs-backend/pinot-driver',
// List for JDBC drivers
'databricks-jdbc': '@cubejs-backend/databricks-jdbc-driver',
Expand Down
2 changes: 2 additions & 0 deletions packages/cubejs-server-core/src/core/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export class CubejsServerCore {

protected readonly orchestratorStorage: OrchestratorStorage = new OrchestratorStorage();

// eslint-disable-next-line @typescript-eslint/no-unused-vars
protected repositoryFactory: ((context: RequestContext) => SchemaFileRepository) | (() => FileRepository);

protected contextToDbType: DbTypeAsyncFn;
Expand Down Expand Up @@ -141,6 +142,7 @@ export class CubejsServerCore {

protected apiGatewayInstance: ApiGateway | null = null;

// eslint-disable-next-line @typescript-eslint/no-unused-vars
public readonly event: (name: string, props?: object) => Promise<void>;

public projectFingerprint: string | null = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export * from './clickhouse';
export * from './questdb';
export * from './materialize';
export * from './crate';
export * from './vertica';
export * from './prestodb';
export * from './mssql';
export * from './trino';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { GenericContainer, Wait } from 'testcontainers';
import { isCI } from '@cubejs-backend/shared';

import { DbRunnerAbstract, DBRunnerContainerOptions } from './db-runner.abstract';

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { GenericContainer, Wait } from 'testcontainers';
import { DbRunnerAbstract } from './db-runner.abstract';

export class VerticaDBRunner extends DbRunnerAbstract {
public static startContainer() {
const version = process.env.TEST_VERTICA_VERSION || '11.1.1-0';

const container = new GenericContainer(`vertica/vertica-ce:${version}`)
.withEnvironment({ TZ: 'Antarctica/Troll', VERTICA_DB_NAME: 'test' })
.withExposedPorts(5433)
.withStartupTimeout(60 * 1000)
.withWaitStrategy(
Wait.forLogMessage('Node Status: v_test_node0001: (UP)')
);

return container.start();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export const DB_CAST = {
SELECT_PREFIX: 'with tmp_tbl as (\n',
SELECT_SUFFIX: ')\nselect * from tmp_tbl',
},
vertica: {
SELECT_PREFIX: '',
SELECT_SUFFIX: '',
},
};
export const DATE_CAST = {
athena: {
Expand All @@ -49,4 +53,8 @@ export const DATE_CAST = {
DATE_PREFIX: 'to_date(',
DATE_SUFFIX: ', \'YYYY-MM-DD\')',
},
vertica: {
DATE_PREFIX: 'to_date(',
DATE_SUFFIX: ', \'YYYY-MM-DD\')',
},
};
44 changes: 44 additions & 0 deletions packages/cubejs-testing/birdbox-fixtures/vertica.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: "2.2"

services:
cube:
container_name: birdbox-cube
image: ${BIRDBOX_CUBEJS_REGISTRY_PATH}cubejs/cube:${BIRDBOX_CUBEJS_VERSION:-latest}
environment:
CUBEJS_DB_TYPE: vertica

CUBEJS_DB_HOST: db
CUBEJS_DB_PORT: 5433
CUBEJS_DB_NAME: vmart
CUBEJS_DB_USER: dbadmin
CUBEJS_DB_PASS:

CUBEJS_DEV_MODE: "true"
CUBEJS_WEB_SOCKETS: "true"
CUBEJS_API_SECRET: mysupersecret
volumes:
- ./vertica/schema:/cube/conf/schema
ports:
- "4000"
depends_on:
db:
condition: service_healthy
links:
- db
restart: always

# Database instances, for troubleshooting.
# NOT required.
# Tests provide db instances via testcontainers, in both LOCAL and DOCKER modes.

db:
container_name: birdbox-db
image: vertica/vertica-ce:11.1.1-0
ports:
- "5433"
restart: always
healthcheck:
test: ["CMD-SHELL", "/opt/vertica/bin/vsql -c 'select 1;' || exit 1"]
interval: 10s
timeout: 5s
retries: 5
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
cube(`Orders`, {
sql: `
with orders as (
select 1 as id, 100 as amount, 'new' status
UNION ALL
select 2 as id, 200 as amount, 'new' status
UNION ALL
select 3 as id, 300 as amount, 'processed' status
UNION ALL
select 4 as id, 500 as amount, 'processed' status
UNION ALL
select 5 as id, 600 as amount, 'shipped' status
)
select * from orders
`,
measures: {
count: {
type: `count`,
},
totalAmount: {
sql: `amount`,
type: `sum`,
},
toRemove: {
type: `count`,
},
},
dimensions: {
status: {
sql: `status`,
type: `string`,
},
},
});
4 changes: 4 additions & 0 deletions packages/cubejs-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
"driver:questdb:snap": "jest --verbose --updateSnapshot -i dist/test/driver-questdb.test.js",
"driver:databricks": "jest --verbose -i dist/test/driver-databricks.test.js",
"driver:databricks:snap": "jest --verbose --updateSnapshot -i dist/test/driver-databricks.test.js",
"driver:vertica": "jest --verbose -i dist/test/driver-vertica.test.js",
"driver:vertica:snap": "jest --verbose --updateSnapshot -i dist/test/driver-vertica.test.js",
"integration:cubestore": "jest --verbose --updateSnapshot -i dist/test/driver-cubestore.test.js",
"rest:postgres": "yarn tsc && clear && jest --verbose -i dist/test/rest-postgres.test.js",
"smoke:athena": "jest --verbose -i dist/test/smoke-athena.test.js",
Expand Down Expand Up @@ -73,6 +75,8 @@
"smoke:postgres": "jest --verbose -i dist/test/smoke-postgres.test.js",
"smoke:redshift": "jest --verbose -i dist/test/smoke-redshift.test.js",
"smoke:redshift:snapshot": "jest --verbose --updateSnapshot -i dist/test/smoke-redshift.test.js",
"smoke:vertica": "jest --verbose -i dist/test/smoke-vertica.test.js",
"smoke:vertica:snapshot": "jest --verbose --updateSnapshot -i dist/test/smoke-vertica.test.js",
"smoke:rbac": "TZ=UTC jest --verbose -i dist/test/smoke-rbac.test.js",
"smoke:cubesql": "TZ=UTC jest --verbose --forceExit -i dist/test/smoke-cubesql.test.js",
"smoke:cubesql:snapshot": "TZ=UTC jest --verbose --forceExit --updateSnapshot -i dist/test/smoke-cubesql.test.js",
Expand Down
1 change: 1 addition & 0 deletions packages/cubejs-testing/src/REQUIRED_ENV_VARS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const REQUIRED_ENV_VARS: {[key: string]: string[]} = {
'CUBEJS_DB_EXPORT_BUCKET_AWS_SECRET',
'CUBEJS_DB_EXPORT_BUCKET_AWS_REGION',
],
vertica: [],
prestodb: [],
trino: [],
mssql: [],
Expand Down
5 changes: 3 additions & 2 deletions packages/cubejs-testing/src/birdbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ interface Args {
log: Log,
}

export type DriverType = 'postgresql' | 'postgres' | 'multidb' | 'materialize' | 'crate' | 'bigquery' | 'athena' | 'postgresql-cubestore' | 'firebolt' | 'questdb' | 'redshift' | 'databricks-jdbc' | 'prestodb' | 'mssql' | 'trino' | 'oracle' | 'duckdb' | 'snowflake';
export type DriverType = 'postgresql' | 'postgres' | 'multidb' | 'materialize' | 'crate' | 'bigquery' | 'athena' | 'postgresql-cubestore' | 'firebolt' | 'questdb' | 'redshift' | 'databricks-jdbc' | 'prestodb' | 'mssql' | 'trino' | 'oracle' | 'duckdb' | 'snowflake' | 'vertica';

export type Schemas = string[];

Expand Down Expand Up @@ -103,6 +103,7 @@ const driverNameToFolderNameMapper: Record<DriverType, string> = {
questdb: 'postgresql',
redshift: 'postgresql',
'databricks-jdbc': 'databricks-jdbc',
vertica: 'vertica',
prestodb: 'postgresql',
mssql: 'mssql',
trino: 'postgresql',
Expand Down Expand Up @@ -262,7 +263,7 @@ export async function startBirdBoxFromContainer(
if (pid !== null) {
process.kill(pid, signal);
} else {
process.stdout.write(`[Birdbox] Cannot kill Cube instance running in TEST_CUBE_HOST mode without TEST_CUBE_PID defined\n`);
process.stdout.write('[Birdbox] Cannot kill Cube instance running in TEST_CUBE_HOST mode without TEST_CUBE_PID defined\n');
throw new Error('Attempted to use killCube while running with TEST_CUBE_HOST');
}
},
Expand Down
Loading
Loading