Skip to content

Commit ccdd87a

Browse files
committed
Merge remote-tracking branch 'upstream/master' into vertica_driver
2 parents 5fbbb1a + 731b431 commit ccdd87a

File tree

148 files changed

+1938
-411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+1938
-411
lines changed

.github/workflows/examples-publish.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,58 @@ on:
1111

1212
jobs:
1313

14+
clickhouse-multi-tenancy:
15+
runs-on: ubuntu-20.04
16+
timeout-minutes: 30
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- uses: pheel/path-watcher-action@v1
22+
id: modified
23+
with:
24+
paths: '.github/workflows/examples-publish.yml,.github/actions/deploy-example.sh,examples/building-an-open-source-data-stack-with-clickhouse-and-cube-workshop/*,examples/building-an-open-source-data-stack-with-clickhouse-and-cube-workshop/**'
25+
26+
- if: steps.modified.outputs.modified
27+
uses: actions/setup-node@v1
28+
with:
29+
node-version: 14.x
30+
31+
- if: steps.modified.outputs.modified
32+
run: .github/actions/deploy-example.sh
33+
env:
34+
EXAMPLE_SLUG: building-an-open-source-data-stack-with-clickhouse-and-cube-workshop
35+
EXAMPLE_FRONTEND_SUBDIRECTORY: dashboard-app-multi-tenancy
36+
EXAMPLE_FRONTEND_BUILD_SUBDIRECTORY: dist/
37+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
38+
EXAMPLE_CUBE_SKIP: 1
39+
40+
clickhouse-multiple-sources:
41+
runs-on: ubuntu-20.04
42+
timeout-minutes: 30
43+
44+
steps:
45+
- uses: actions/checkout@v2
46+
47+
- uses: pheel/path-watcher-action@v1
48+
id: modified
49+
with:
50+
paths: '.github/workflows/examples-publish.yml,.github/actions/deploy-example.sh,examples/building-an-open-source-data-stack-with-clickhouse-and-cube-workshop/*,examples/building-an-open-source-data-stack-with-clickhouse-and-cube-workshop/**'
51+
52+
- if: steps.modified.outputs.modified
53+
uses: actions/setup-node@v1
54+
with:
55+
node-version: 14.x
56+
57+
- if: steps.modified.outputs.modified
58+
run: .github/actions/deploy-example.sh
59+
env:
60+
EXAMPLE_SLUG: building-an-open-source-data-stack-with-clickhouse-and-cube-workshop
61+
EXAMPLE_FRONTEND_SUBDIRECTORY: dashboard-app-multiple-data-sources
62+
EXAMPLE_FRONTEND_BUILD_SUBDIRECTORY: dist/
63+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
64+
EXAMPLE_CUBE_SKIP: 1
65+
1466
apollo-federation:
1567
runs-on: ubuntu-20.04
1668
timeout-minutes: 30

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,37 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [0.31.3](https://github.com/cube-js/cube.js/compare/v0.31.2...v0.31.3) (2022-10-08)
7+
8+
9+
### Bug Fixes
10+
11+
* drivers imports alignment ([#5448](https://github.com/cube-js/cube.js/issues/5448)) ([ab12426](https://github.com/cube-js/cube.js/commit/ab1242650ba0368b855176b9c6ca2d73073acf0e))
12+
13+
14+
15+
16+
17+
## [0.31.2](https://github.com/cube-js/cube.js/compare/v0.31.1...v0.31.2) (2022-10-08)
18+
19+
20+
### Bug Fixes
21+
22+
* Added connection test completed successfully log ([#5444](https://github.com/cube-js/cube.js/issues/5444)) ([a8e1180](https://github.com/cube-js/cube.js/commit/a8e1180d4c05e8de94b116f46f40db531d91e0eb))
23+
* Temp tables dropped for ksql after successfully created ([#5445](https://github.com/cube-js/cube.js/issues/5445)) ([7726c82](https://github.com/cube-js/cube.js/commit/7726c82fc833a6b14eeeb498a31df62ba9818336))
24+
* **cubesql:** Handle Panic on simple query executiony ([#5394](https://github.com/cube-js/cube.js/issues/5394)) ([84dc442](https://github.com/cube-js/cube.js/commit/84dc442eb1c42bc3c7b7b03fe365c7c0a948e328))
25+
26+
27+
### Features
28+
29+
* **mssql-driver:** add column type mapping for a bit type ([#5442](https://github.com/cube-js/cube.js/issues/5442)) ([0ed7ba4](https://github.com/cube-js/cube.js/commit/0ed7ba4b483fff8653602f89f43bd1b03b458859))
30+
* Includes and Excludes directives for Cube Views ([#5437](https://github.com/cube-js/cube.js/issues/5437)) ([7c35604](https://github.com/cube-js/cube.js/commit/7c356049b56a0ea58a4ad8f2628ffaff2ac307d4))
31+
* **cubesql:** Support boolean decoding in pg-wire ([#5436](https://github.com/cube-js/cube.js/issues/5436)) ([4fd2ee6](https://github.com/cube-js/cube.js/commit/4fd2ee6cd238161f889896739a00f09e6dc11651))
32+
33+
34+
35+
36+
637
## [0.31.1](https://github.com/cube-js/cube.js/compare/v0.31.0...v0.31.1) (2022-10-04)
738

839

docs/content/Configuration/Environment-Variables-Reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ options][link-config].
2020
| `CUBEJS_DEV_MODE` | If `true`, enables development mode. Defaults to `false` | `true`, `false` |
2121
| `CUBEJS_API_SECRET` | The secret key used to sign and verify JWTs. Generated on project scaffold | A valid string |
2222
| `CUBEJS_APP` | An application ID used to uniquely identify the Cube.js deployment. Can be different for multitenant setups. Defaults to `cubejs` | A valid string |
23-
| `CUBEJS_BUILD_PRE_AGGREGATIONS` | If `true`, this instance of Cube will build pre-aggregations, even if it is an API instance. Defaults to `false` | `true`, `false` |
23+
| `CUBEJS_PRE_AGGREGATIONS_BUILDER` | If `true`, this instance of Cube will build pre-aggregations, even if it is an API instance. Defaults to `true` if it's refresh worker instance or instance which is in development mode. Defaults to `false` otherwise. | `true`, `false` |
2424
| `CUBEJS_REFRESH_WORKER` | If `true`, this instance of Cube.js will **only** refresh pre-aggregations. Defaults to `false` | `true`, `false` |
2525
| `CUBEJS_ROLLUP_ONLY` | If `true`, this instance of Cube.js will **only** query rollup pre-aggregations. Defaults to `false` | `true`, `false` |
2626
| `CUBEJS_SCHEDULED_REFRESH_TIMEZONES` | A comma-separated [list of timezones to schedule refreshes for][ref-config-sched-refresh-timer]. | [A valid timezone from the tz database][link-tz-database] |

docs/src/pages/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class IndexPage extends Component<Props> {
3232
<meta name="description" content={"Main | Documentation for working with Cube, the open-source analytics framework"}></meta>
3333
</Helmet>
3434
<h1>Documentation</h1>
35-
35+
3636
<Row>
3737
<Col span={24}>
3838
<p>
@@ -83,7 +83,7 @@ class IndexPage extends Component<Props> {
8383
title="Deployment"
8484
img={imgInsights}
8585
desc="Deploying your application to Cube Cloud, a public cloud, or on-premise"
86-
to="/deployment"
86+
to="/deployment/overview"
8787
right
8888
/>
8989
</Row>

examples/building-an-open-source-data-stack-with-clickhouse-and-cube-workshop/cube.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
// const clickhouseDatabase = process.env.CUBEJS_DB_NAME;
1515
// const clickhouseUser = process.env.CUBEJS_DB_USER;
1616
// const clickhousePassword = process.env.CUBEJS_DB_PASS;
17-
// const mysqlHost = 'demo-mysql-rhodges.czuu1tdfcpyt.us-east-1.rds.amazonaws.com';
18-
// const mysqlPort = '3306';
19-
// const mysqlDatabase = 'test';
20-
// const mysqlUser = 'admin';
21-
// const mysqlPassword = 'YIDrkjMThI9ZHtdOfjj7';
17+
// const mysqlHost = '<host>';
18+
// const mysqlPort = '3306';
19+
// const mysqlDatabase = '<db>';
20+
// const mysqlUser = '<user>';
21+
// const mysqlPassword = '<pass>';
2222

2323
module.exports = {
2424
/**
@@ -67,7 +67,7 @@ module.exports = {
6767

6868
// if (securityContext.dataSource === 'mysql') {
6969
// return {
70-
// type: 'postgres', // replace with mysql once we get an endpoint
70+
// type: 'mysql',
7171
// database: mysqlDatabase,
7272
// host: mysqlHost,
7373
// user: mysqlUser,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"siteId": "54de7f02-f32e-427e-a500-9206e10f38aa"
3+
}

examples/building-an-open-source-data-stack-with-clickhouse-and-cube-workshop/dashboard-app-multi-tenancy/src/components/BarChart.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const BarChart = ({ data /* see data tab */ }) => {
2222
}}
2323
axisBottom={{
2424
format: value =>
25-
ticksFormmater(20, value, data.chartPivot(), dateFormatter)
25+
ticksFormmater(15, value, data.chartPivot(), dateFormatter)
2626
}}
2727
tooltip={({ id, value, color }) => (
2828
<strong style={{ color, backgroundColor: 'white', padding: '5px', borderRadius: '5px' }}>

examples/building-an-open-source-data-stack-with-clickhouse-and-cube-workshop/dashboard-app-multi-tenancy/src/index.js

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ import {
99
defaultDataSourceId,
1010
dataSources,
1111
DisplayBarChart,
12+
years,
13+
months,
14+
defaultYearId,
15+
defaultMonthId,
1216
jsonQuery,
17+
randomIntFromInterval,
1318
} from './utils/utils'
1419

1520
ReactDOM
@@ -24,6 +29,17 @@ function App() {
2429
const [ dataSourceId, setDataSourceId ] = useState(defaultDataSourceId)
2530
const dataSource = dataSources.find(x => x.id === dataSourceId)
2631

32+
const [ yearId, setYearId ] = useState(defaultYearId)
33+
const year = years.find(x => x.id === yearId)
34+
35+
const [ monthId, setMonthId ] = useState(defaultMonthId)
36+
const month = months.find(x => x.id === monthId)
37+
38+
const shuffleAndRun = () => {
39+
setYearId(randomIntFromInterval(1, 34))
40+
setMonthId(randomIntFromInterval(1, 12))
41+
}
42+
2743
const cubejsApi = cubejs(
2844
dataSource.token,
2945
{ apiUrl },
@@ -36,7 +52,7 @@ function App() {
3652

3753
setOntimeBarData({})
3854
cubejsApi
39-
.load(jsonQuery())
55+
.load(jsonQuery({ year, month }))
4056
.then(setOntimeBarData)
4157
.then(() => {
4258
const end = Date.now()
@@ -46,12 +62,14 @@ function App() {
4662
}, [
4763
dataSource.token,
4864
apiUrl,
65+
year.year,
66+
month.id,
4967
])
5068

5169
return <>
52-
<div style={{ display: 'flex', justifyContent: 'center' }}>
70+
<div style={{ display: 'flex', justifyContent: 'center', padding: '0 0 20px 0' }}>
5371
<div style={{ display: 'flex', justifyContent: 'center' }}>
54-
<label style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>Authorization token</label>
72+
<label style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>Auth token</label>
5573
<textarea
5674
readOnly
5775
value={dataSource.token}
@@ -73,13 +91,45 @@ function App() {
7391
</select>
7492
</div>
7593

94+
<div style={{ display: 'flex', justifyContent: 'center' }}>
95+
<select
96+
className={classes.select}
97+
value={yearId}
98+
onChange={e => setYearId(parseInt(e.target.value))}
99+
>
100+
<option value="" disabled>Select year...</option>
101+
{years.map(year => (
102+
<option key={year.id} value={year.id}>
103+
{year.year}
104+
</option>
105+
))}
106+
</select>
107+
<select
108+
className={classes.select}
109+
value={monthId}
110+
onChange={e => setMonthId(parseInt(e.target.value))}
111+
>
112+
<option value="" disabled>Select month...</option>
113+
{months.map(month => (
114+
<option key={month.id} value={month.id}>
115+
{month.month}
116+
</option>
117+
))}
118+
</select>
119+
<div className={`${classes.buttonwrp}`}>
120+
<button className={`Button Button--size-s Button--pink`} onClick={shuffleAndRun}>
121+
Shuffle and Run!
122+
</button>
123+
</div>
124+
</div>
125+
76126
<div style={{ display: 'flex', justifyContent: 'center' }}>
77127
<table style={{ width: '80%' }}>
78128
<tbody>
79129
<tr>
80130
<td style={{ width: '100%' }}>
81131
<div style={{ height: '375px', margin: '20px 0' }}>
82-
<h3 style={{display: 'flex', justifyContent: 'center'}}>{ (timer.responseTime / 1000) || '...' } seconds</h3>
132+
<h3 style={{display: 'flex', justifyContent: 'center'}}>{ (timer.responseTime) ? `${timer.responseTime / 1000} seconds` : '' }</h3>
83133
<DisplayBarChart
84134
chartData={ontimeBarData}
85135
/>

examples/building-an-open-source-data-stack-with-clickhouse-and-cube-workshop/dashboard-app-multi-tenancy/src/utils/utils.js

Lines changed: 67 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,71 @@ export const ticksFormmater = (ticksCount, value, data, dateFormatter) => {
1313
return ""
1414
}
1515
export const numberFormatter = (item) => numeral(item/100).format("0%")
16-
export const dateFormatter = (item) => moment(item).format("YYYY")
16+
export const dateFormatter = (item) => moment(item).format("DD")
1717
export const colors = ["#7DB3FF", "#49457B", "#FF7C78"]
1818

1919
const isEmpty = (obj) => Object.keys(obj).length === 0
2020

21+
export const randomIntFromInterval = (min, max) => {
22+
return Math.floor(Math.random() * (max - min + 1) + min)
23+
}
24+
25+
export const years = [
26+
{ id: 1, year: 1988 },
27+
{ id: 2, year: 1989 },
28+
{ id: 3, year: 1990 },
29+
{ id: 4, year: 1991 },
30+
{ id: 5, year: 1992 },
31+
{ id: 6, year: 1993 },
32+
{ id: 7, year: 1994 },
33+
{ id: 8, year: 1995 },
34+
{ id: 9, year: 1996 },
35+
{ id: 10, year: 1997 },
36+
{ id: 11, year: 1998 },
37+
{ id: 12, year: 1999 },
38+
{ id: 13, year: 2000 },
39+
{ id: 14, year: 2001 },
40+
{ id: 15, year: 2002 },
41+
{ id: 16, year: 2003 },
42+
{ id: 17, year: 2004 },
43+
{ id: 18, year: 2005 },
44+
{ id: 19, year: 2006 },
45+
{ id: 20, year: 2007 },
46+
{ id: 21, year: 2008 },
47+
{ id: 22, year: 2009 },
48+
{ id: 23, year: 2010 },
49+
{ id: 24, year: 2011 },
50+
{ id: 25, year: 2012 },
51+
{ id: 26, year: 2013 },
52+
{ id: 27, year: 2014 },
53+
{ id: 28, year: 2015 },
54+
{ id: 29, year: 2016 },
55+
{ id: 30, year: 2017 },
56+
{ id: 31, year: 2018 },
57+
{ id: 32, year: 2019 },
58+
{ id: 33, year: 2020 },
59+
{ id: 34, year: 2021 },
60+
];
61+
62+
export const months = [
63+
{ id: 1, month: 'January', end: 31 },
64+
{ id: 2, month: 'February', end: 28 },
65+
{ id: 3, month: 'March', end: 31 },
66+
{ id: 4, month: 'April', end: 30 },
67+
{ id: 5, month: 'May', end: 31 },
68+
{ id: 6, month: 'June', end: 30 },
69+
{ id: 7, month: 'July', end: 31 },
70+
{ id: 8, month: 'August', end: 31 },
71+
{ id: 9, month: 'September', end: 30 },
72+
{ id: 10, month: 'October', end: 31 },
73+
{ id: 11, month: 'November', end: 30 },
74+
{ id: 12, month: 'December', end: 31 },
75+
];
76+
2177
const defaultJwtSecret = '1c7548fdc11622f711fd0113139feefc4cbd88826d3107b29b4950b0b1df159c'
2278
export const defaultDataSourceId = 1
79+
export const defaultYearId = 1
80+
export const defaultMonthId = 1
2381
/** OSS Cube */
2482
// const defaultApiUrl = 'http://localhost:4000/cubejs-api/v1'
2583
/** Cube Cloud */
@@ -39,12 +97,16 @@ export const dataSources = [
3997
}, jwtSecret),
4098
}))
4199

42-
export const jsonQuery = () => ({
100+
export const jsonQuery = ({ year, month }) => ({
43101
measures: [ `Ontime.avgDepDelayGreaterThanTenMinutesPercentage` ],
44-
timeDimensions: [ {
102+
timeDimensions: [{
45103
dimension: `Ontime.flightdate`,
46-
granularity: 'year',
47-
} ],
104+
granularity: 'day',
105+
dateRange: [
106+
`${year.year}-${month.id}-01`,
107+
`${year.year}-${month.id}-${month.end}`
108+
]
109+
}]
48110
})
49111

50112
export function DisplayBarChart({ chartData }) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"siteId": "7767f9e9-44b7-4a7f-b9d2-4fa1d84e93f8"
3+
}

0 commit comments

Comments
 (0)