Skip to content

Commit 6ce8205

Browse files
committed
Merge branch 'master' into fix-index-and-expression
2 parents 296b23a + 232c626 commit 6ce8205

File tree

11 files changed

+102
-53
lines changed

11 files changed

+102
-53
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
set -eo pipefail
3+
4+
# Debug log for test containers
5+
export DEBUG=testcontainers
6+
7+
echo "::group::Firebolt [cloud]"
8+
yarn lerna run --concurrency 1 --stream --no-prefix integration:firebolt
9+
10+
echo "::endgroup::"

.github/workflows/push.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ jobs:
319319
node-version: [20.x]
320320
db: [
321321
'clickhouse', 'druid', 'elasticsearch', 'mssql', 'mysql', 'postgres', 'prestodb',
322-
'mysql-aurora-serverless', 'crate', 'mongobi'
322+
'mysql-aurora-serverless', 'crate', 'mongobi', 'firebolt'
323323
]
324324
fail-fast: false
325325

@@ -370,6 +370,13 @@ jobs:
370370
retry_wait_seconds: 15
371371
timeout_minutes: 30
372372
command: ./.github/actions/integration/${{ matrix.db }}.sh
373+
env:
374+
# Firebolt Integration
375+
DRIVERS_TESTS_FIREBOLT_CUBEJS_FIREBOLT_ENGINE_NAME: ${{ secrets.DRIVERS_TESTS_FIREBOLT_CUBEJS_FIREBOLT_ENGINE_NAME }}
376+
DRIVERS_TESTS_FIREBOLT_CUBEJS_DB_NAME: ${{ secrets.DRIVERS_TESTS_FIREBOLT_CUBEJS_DB_NAME }}
377+
DRIVERS_TESTS_FIREBOLT_CUBEJS_FIREBOLT_ACCOUNT: ${{ secrets.DRIVERS_TESTS_FIREBOLT_CUBEJS_FIREBOLT_ACCOUNT }}
378+
DRIVERS_TESTS_FIREBOLT_CUBEJS_DB_USER: ${{ secrets.DRIVERS_TESTS_FIREBOLT_CUBEJS_DB_USER }}
379+
DRIVERS_TESTS_FIREBOLT_CUBEJS_DB_PASS: ${{ secrets.DRIVERS_TESTS_FIREBOLT_CUBEJS_DB_PASS }}
373380

374381
integration-smoke:
375382
needs: [ latest-tag-sha, build-cubestore ]

docs/pages/product/apis-integrations/ai-api.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Specifically, you can send the AI API a message (or conversation of messages) an
1111
your Cube representative to have it enabled for your account.
1212
</WarningBox>
1313

14+
See [AI API reference][ref-ref-ai-api] for the list of supported API endpoinsts.
15+
1416
## Configuration
1517

1618
While the AI API is in preview, your Cube account team will enable and configure it for you.
@@ -217,4 +219,7 @@ deployment. See below for required variables by provider (required unless noted)
217219
#### OpenAI
218220

219221
- `OPENAI_MODEL` - An OpenAI chat model ID, for example `gpt-4o`
220-
- `OPENAI_API_KEY` - An OpenAI API key (we recommend creating a service account for the AI API)
222+
- `OPENAI_API_KEY` - An OpenAI API key (we recommend creating a service account for the AI API)
223+
224+
225+
[ref-ref-ai-api]: /reference/ai-api

docs/pages/product/apis-integrations/rest-api.mdx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ data applications, including but not limited to the following ones:
1616
Often, the REST API is used to enable [embedded analytics][cube-ea] and
1717
[real-time analytics][cube-rta] use cases.
1818

19+
See [REST API reference][ref-ref-rest-api] for the list of supported API endpoinsts.
20+
Also, check [query format][ref-rest-query-format] for details about query syntax.
21+
22+
<InfoBox>
23+
24+
You can find a mostly complete OpenAPI documentation for the REST API in the
25+
linked [`openspec.yml` file][gh-cube-openspec] that you can use with tools like Swagger.
26+
27+
</InfoBox>
28+
1929
<InfoBox>
2030

2131
If you've chosen [GraphQL][graphql] as a query language for your front-end
@@ -24,10 +34,9 @@ provides.
2434

2535
</InfoBox>
2636

27-
Under the hood, REST API also provides endpoints for [GraphQL
28-
API][ref-graphql-api] and [Orchestration API][ref-orchestration-api]. However,
29-
they target specific use cases and are not usually considered part of the REST
30-
API.
37+
REST API also provides endpoints for [GraphQL API][ref-graphql-api] and
38+
[Orchestration API][ref-orchestration-api]. However, they target specific use
39+
cases and are not considered part of the REST API.
3140

3241
## Example request
3342

@@ -84,10 +93,6 @@ curl \
8493
http://localhost:4000/cubejs-api/v1/meta | jq
8594
```
8695

87-
Check [query format][ref-rest-query-format] for details about supported queries.
88-
Also, check [REST API reference][ref-ref-rest-api] for the list of supported API
89-
endpoints.
90-
9196
## Configuration
9297

9398
REST API is enabled by default and secured using [API scopes][self-api-scopes]
@@ -291,3 +296,4 @@ example, the following query will retrieve rows 101-200 from the `Orders` cube:
291296
[self-cors]: #configuration-cors
292297
[ref-ref-rest-api]: /reference/rest-api
293298
[link-jq-utility]: https://jqlang.github.io/jq/
299+
[gh-cube-openspec]: https://github.com/cube-js/cube/blob/master/packages/cubejs-api-gateway/openspec.yml

docs/pages/product/apis-integrations/sql-api.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ but not limited to the following ones:
2020
Often, the SQL API is used to enable internal or self-serve [business
2121
intelligence][cube-bi-use-case] use cases.
2222

23+
See [SQL API reference][ref-ref-sql-api] for the list of supported SQL commands,
24+
functions, and operators. Also, check [query format][ref-sql-query-format] for
25+
details about supported queries.
26+
2327
<InfoBox>
2428

2529
Please use [this GitHub issue](https://github.com/cube-js/cube/issues/3906) to
@@ -78,10 +82,6 @@ WHERE table_schema = 'public';
7882
\d
7983
```
8084

81-
Check [query format][ref-sql-query-format] for details about supported queries.
82-
Also, check [SQL API reference][ref-ref-sql-api] for the list of supported SQL
83-
commands, functions, and operators.
84-
8585
## Fundamentals
8686

8787
In the SQL API, each cube or view from the [data model][ref-data-model-concepts]

docs/pages/product/caching/using-pre-aggregations.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,12 @@ The data for `zip_code_index` would look as follows:
601601
| 88523 | 3800 |
602602
| 88524 | 5000 |
603603

604+
### Compaction
605+
606+
Whenever a newer version of pre-aggregation is just built and becomes available its performance would be suboptimal as it's pending compaction.
607+
Most of the essential compaction process usually takes several seconds to several minutes for bigger partitions after pre-aggregation creation, depending on the size of the partition and the Cube Store workers' processing power available.
608+
This compaction process is usually unnoticeable for queries that are optimal in terms of index usage, so it's always best practice to make sure all of your queries match an index.
609+
604610
## Inspecting pre-aggregations
605611

606612
Cube Store partially supports the MySQL protocol. This allows you to execute

packages/cubejs-firebolt-driver/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"watch": "tsc -w",
2424
"test": "yarn integration",
2525
"integration": "npm run integration:firebolt",
26-
"integration:firebolt": "jest --verbose dist/test",
26+
"integration:firebolt": "jest --verbose dist/test --runInBand",
2727
"lint": "eslint src/* --ext .ts",
2828
"lint:fix": "eslint --fix src/* --ext .ts"
2929
},
@@ -43,7 +43,10 @@
4343
"access": "public"
4444
},
4545
"jest": {
46-
"testEnvironment": "node"
46+
"testEnvironment": "node",
47+
"setupFiles": [
48+
"./test/test-env.js"
49+
]
4750
},
4851
"eslintConfig": {
4952
"extends": "../cubejs-linter"

packages/cubejs-firebolt-driver/test/FireboltQuery.test.ts

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -70,50 +70,48 @@ cube(\`sales\`, {
7070
measures: ['sales.count'],
7171
filters: [
7272
{
73-
member: "sales.isShiped",
74-
operator: "equals",
75-
values: ["true"]
73+
member: 'sales.isShiped',
74+
operator: 'equals',
75+
values: ['true']
7676
}
7777
]
7878
}
79-
)
79+
);
8080

8181
const queryAndParams = query.buildSqlAndParams();
8282

8383
expect(queryAndParams[0]).toContain(
8484
'("sales".is_shiped = CAST(? AS BOOLEAN))'
8585
);
8686

87-
expect(queryAndParams[1]).toEqual(["true"]);
88-
}))
89-
it("should cast timestamp", () =>
90-
compiler.compile().then(() => {
91-
const query = new FireboltQuery(
92-
{ joinGraph, cubeEvaluator, compiler },
93-
{
94-
measures: ["sales.count"],
95-
timeDimensions: [
96-
{
97-
dimension: "sales.salesDatetime",
98-
granularity: "day",
99-
dateRange: ["2017-01-01", "2017-01-02"],
100-
},
101-
],
102-
timezone: "America/Los_Angeles",
103-
order: [
104-
{
105-
id: "sales.salesDatetime",
106-
},
107-
],
108-
}
109-
);
110-
111-
const queryAndParams = query.buildSqlAndParams();
87+
expect(queryAndParams[1]).toEqual(['true']);
88+
}));
11289

113-
expect(queryAndParams[0]).toContain(
114-
'("sales".sales_datetime >= ?::timestamptz AND "sales".sales_datetime <= ?::timestamptz)'
115-
);
116-
}));
90+
it('should cast timestamp', () => compiler.compile().then(() => {
91+
const query = new FireboltQuery(
92+
{ joinGraph, cubeEvaluator, compiler },
93+
{
94+
measures: ['sales.count'],
95+
timeDimensions: [
96+
{
97+
dimension: 'sales.salesDatetime',
98+
granularity: 'day',
99+
dateRange: ['2017-01-01', '2017-01-02'],
100+
},
101+
],
102+
timezone: 'America/Los_Angeles',
103+
order: [
104+
{
105+
id: 'sales.salesDatetime',
106+
},
107+
],
108+
}
109+
);
117110

111+
const queryAndParams = query.buildSqlAndParams();
118112

119-
})
113+
expect(queryAndParams[0]).toContain(
114+
'("sales".sales_datetime >= ?::timestamptz AND "sales".sales_datetime <= ?::timestamptz)'
115+
);
116+
}));
117+
});

packages/cubejs-firebolt-driver/test/autostart.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import {assertDataSource, getEnv} from '@cubejs-backend/shared';
1+
import { assertDataSource, getEnv } from '@cubejs-backend/shared';
22
import { DriverTests } from '@cubejs-backend/testing-shared';
33

4-
import { FireboltDriver } from '../src';
54
import { Firebolt } from 'firebolt-sdk';
65
import { version } from 'firebolt-sdk/package.json';
6+
import { FireboltDriver } from '../src';
77

88
describe('FireboltDriver autostart', () => {
99
let tests: DriverTests;
@@ -43,7 +43,7 @@ describe('FireboltDriver autostart', () => {
4343
const engineName = getEnv('fireboltEngineName', { dataSource });
4444
const firebolt = Firebolt({
4545
apiEndpoint: getEnv('fireboltApiEndpoint', { dataSource }) || 'api.app.firebolt.io',
46-
})
46+
});
4747
await firebolt.connect({
4848
auth,
4949
database: getEnv('dbName', { dataSource }),

0 commit comments

Comments
 (0)