-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add improved examples for reporting pipeline
- Loading branch information
Showing
2 changed files
with
66 additions
and
14 deletions.
There are no files selected for viewing
56 changes: 43 additions & 13 deletions
56
analytics-datastore-clickhouse/importer/config/clickhouseTables.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,52 @@ | ||
const CLUSTERED_MODE = process.env.CLUSTERED_MODE || 'true'; | ||
const CLUSTERED_MODE = process.env.CLUSTERED_MODE || "true"; | ||
|
||
const queries = | ||
Boolean(CLUSTERED_MODE) === true | ||
? [ | ||
`CREATE TABLE default_table( | ||
createdAt Date, | ||
updatedAt Date | ||
) | ||
ENGINE=MergeTree | ||
ORDER BY tuple();`, | ||
`CREATE TABLE patient_example( | ||
id String, | ||
version String NULL, | ||
inserted_at DateTime DEFAULT now(), | ||
last_updated Date NULL, | ||
goldenId String, | ||
patientGivenName String, | ||
patientFamilyName String, | ||
) | ||
ENGINE=MergeTree | ||
ORDER BY tuple();`, | ||
`CREATE TABLE observation_example( | ||
id String, | ||
version String NULL, | ||
inserted_at DateTime DEFAULT now(), | ||
last_updated Date NULL, | ||
observationValue Double, | ||
patientId String, | ||
) | ||
ENGINE=MergeTree | ||
ORDER BY tuple();`, | ||
] | ||
: [ | ||
`CREATE TABLE default.default_table ON CLUSTER '{cluster}' ( | ||
createdAt Date, | ||
updatedAt Date | ||
) | ||
ENGINE = ReplicatedMergeTree('/clickhouse/tables/{cluster}/{shard}/{table}', '{replica}') | ||
ORDER BY tuple();`, | ||
`CREATE TABLE patient_example ON CLUSTER '{cluster}' ( | ||
id String, | ||
version String NULL, | ||
inserted_at DateTime DEFAULT now(), | ||
last_updated Date NULL, | ||
goldenId String, | ||
patientGivenName String, | ||
patientFamilyName String, | ||
) | ||
ENGINE = ReplicatedMergeTree('/clickhouse/tables/{cluster}/{shard}/{table}', '{replica}') | ||
ORDER BY tuple();`, | ||
`CREATE TABLE observation_example ON CLUSTER '{cluster}' ( | ||
id String, | ||
version String NULL, | ||
inserted_at DateTime DEFAULT now(), | ||
last_updated Date NULL, | ||
observationValue Double, | ||
patientId String, | ||
) | ||
ENGINE = ReplicatedMergeTree('/clickhouse/tables/{cluster}/{shard}/{table}', '{replica}') | ||
ORDER BY tuple();`, | ||
]; | ||
|
||
module.exports = queries; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters