File tree Expand file tree Collapse file tree 4 files changed +50
-9
lines changed
product/configuration/data-sources
cubejs-backend-shared/src Expand file tree Collapse file tree 4 files changed +50
-9
lines changed Original file line number Diff line number Diff line change @@ -42,14 +42,15 @@ CUBEJS_DB_PASS=**********
4242
4343## Environment Variables
4444
45- | Environment Variable | Description | Possible Values | Required |
46- | ----------------------| --------------------------------------------| ---------------------| :--------:|
47- | ` CUBEJS_DB_HOST ` | The host URL for your Pinot broker | A valid host URL | ✅ |
48- | ` CUBEJS_DB_PORT ` | The port for the database connection | A valid port number | ✅ |
49- | ` CUBEJS_DB_USER ` | The username used to connect to the broker | A valid username | ❌ |
50- | ` CUBEJS_DB_PASS ` | The password used to connect to the broker | A valid password | ❌ |
51- | ` CUBEJS_DB_NAME ` | The database name for StarTree | A valid name | ❌ |
52- | ` CUBEJS_DB_PINOT_AUTH_TOKEN ` | The authentication token for StarTree | A valid token | ❌ |
45+ | Environment Variable | Description | Possible Values | Required |
46+ | ---------------------------------| -------------------------------------------------------| ---------------------| :--------:|
47+ | ` CUBEJS_DB_HOST ` | The host URL for your Pinot broker | A valid host URL | ✅ |
48+ | ` CUBEJS_DB_PORT ` | The port for the database connection | A valid port number | ✅ |
49+ | ` CUBEJS_DB_USER ` | The username used to connect to the broker | A valid username | ❌ |
50+ | ` CUBEJS_DB_PASS ` | The password used to connect to the broker | A valid password | ❌ |
51+ | ` CUBEJS_DB_NAME ` | The database name for StarTree | A valid name | ❌ |
52+ | ` CUBEJS_DB_PINOT_NULL_HANDLING ` | If ` true ` , enables null handling. Default is ` false ` | ` true ` , ` false ` | ❌ |
53+ | ` CUBEJS_DB_PINOT_AUTH_TOKEN ` | The authentication token for StarTree | A valid token | ❌ |
5354
5455## Pre-Aggregation Feature Support
5556
Original file line number Diff line number Diff line change @@ -740,6 +740,15 @@ The Snowflake warehouse to use when connecting to the database.
740740| ---------------------------------------------------------------------- | ---------------------- | --------------------- |
741741| [ A valid Snowflake warehouse] [ snowflake-docs-warehouse ] in the account | N/A | N/A |
742742
743+ ## ` CUBEJS_DB_PINOT_NULL_HANDLING `
744+
745+ The Startree/Pinot null value support. If ` true ` , enables null handling.
746+
747+ | Possible Values | Default in Development | Default in Production |
748+ | --------------- | ---------------------- | --------------------- |
749+ | ` true ` , ` false ` | ` false ` | ` false ` |
750+
751+
743752## ` CUBEJS_DB_SSL `
744753
745754If ` true ` , enables SSL encryption for database connections from Cube.
Original file line number Diff line number Diff line change @@ -1780,6 +1780,35 @@ const variables: Record<string, (...args: any) => any> = {
17801780 ]
17811781 ) ,
17821782
1783+ /**
1784+ * Pinot / Startree Null value support
1785+ */
1786+
1787+ pinotNullHandling : ( { dataSource } : { dataSource : string } ) => {
1788+ const val = process . env [
1789+ keyByDataSource ( 'CUBEJS_DB_PINOT_NULL_HANDLING' , dataSource )
1790+ ] ;
1791+
1792+ if ( val ) {
1793+ if ( val . toLocaleLowerCase ( ) === 'true' ) {
1794+ return true ;
1795+ } else if ( val . toLowerCase ( ) === 'false' ) {
1796+ return false ;
1797+ } else {
1798+ throw new TypeError (
1799+ `The ${
1800+ keyByDataSource (
1801+ 'CUBEJS_DB_PINOT_NULL_HANDLING' ,
1802+ dataSource ,
1803+ )
1804+ } must be either 'true' or 'false'.`
1805+ ) ;
1806+ }
1807+ } else {
1808+ return false ;
1809+ }
1810+ } ,
1811+
17831812 /** ****************************************************************
17841813 * Dremio Driver *
17851814 ***************************************************************** */
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export type PinotDriverConfiguration = {
3333 ssl ?: string | TLSConnectionOptions ;
3434 dataSource ?: string ;
3535 queryTimeout ?: number ;
36+ nullHandling ?: boolean ;
3637} ;
3738
3839type AuthorizationHeaders = {
@@ -108,6 +109,7 @@ export class PinotDriver extends BaseDriver implements DriverInterface {
108109 : undefined ,
109110 authToken : getEnv ( 'pinotAuthToken' , { dataSource } ) ,
110111 ssl : this . getSslOptions ( dataSource ) ,
112+ nullHandling : getEnv ( 'pinotNullHandling' , { dataSource } ) ,
111113 queryTimeout : getEnv ( 'dbQueryTimeout' , { dataSource } ) ,
112114 ...config
113115 } ;
@@ -167,7 +169,7 @@ export class PinotDriver extends BaseDriver implements DriverInterface {
167169 } ) ,
168170 body : JSON . stringify ( {
169171 sql : query ,
170- queryOptions : `useMultistageEngine=true;enableNullHandling=true ;timeoutMs=${ this . config . queryTimeout } `
172+ queryOptions : `useMultistageEngine=true;enableNullHandling=${ this . config . nullHandling } ;timeoutMs=${ this . config . queryTimeout } `
171173 } )
172174 } ) ;
173175
You can’t perform that action at this time.
0 commit comments