Skip to content

Commit f071e80

Browse files
authored
Merge pull request #1 from jitsucom/initial_commit
Initial commit
2 parents 30a3c4f + 87cfb9b commit f071e80

18 files changed

+2310
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.idea
2+
3+
target/
4+
dbt_modules/
5+
logs/

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# dbt-jitsu
2+
This [dbt package](https://docs.getdbt.com/docs/package-management):
3+
* Transforms pageviews into sessions
4+
* For User stitching please enable builtin Jitsu feature [Retrospective User Recognition](https://jitsu.com/docs/other-features/retrospective-user-recognition)
5+
6+
7+
## Installation instructions
8+
New to dbt packages? Read more about them [here](https://docs.getdbt.com/docs/building-a-dbt-project/package-management/).
9+
1. Include this package in your `packages.yml`
10+
2. Run `dbt deps`
11+
3. Include the following in your `dbt_project.yml` directly within your `vars:` block (making sure to handle indenting appropriately). **Update the value to point to your jitsu pageviews table**.
12+
13+
```YAML
14+
# dbt_project.yml
15+
config-version: 2
16+
...
17+
18+
vars:
19+
jitsu:
20+
jitsu_events_table: "{{ source('jitsu', 'pageviews') }}" #or plane table path like database.schema.table_name
21+
22+
```
23+
24+
4. Optionally configure extra parameters by adding them to your own `dbt_project.yml` file – see [dbt_project.yml](dbt_project.yml)
25+
for more details:
26+
27+
```YAML
28+
# dbt_project.yml
29+
config-version: 2
30+
31+
...
32+
33+
vars:
34+
jitsu:
35+
jitsu_events_table: "{{ source('jitsu', 'pageviews') }}"
36+
jitsu_sessionization_trailing_window: 3
37+
jitsu_session_inactivity_cutoff: 30 * 60
38+
jitsu_pass_through_columns: ['event_type']
39+
jitsu_model_materialized: incremental
40+
41+
```
42+
5. Execute `dbt seed` -- this project includes a CSV that must be seeded for it
43+
the package to run successfully.
44+
6. Execute `dbt run` – the Jitsu Sessions models will get built
45+
46+
## Database support
47+
This package has been tested on
48+
PostgreSQL, ClickHouse, Redshift and BigQuery.
49+
50+
### ClickHouse implementation details
51+
This package relies heavily on SQL window functions.
52+
Because Window functions are considered as an [experimental feature in ClickHouse](https://clickhouse.tech/docs/en/sql-reference/window-functions/)
53+
we cannot guarantee stable results of using this package with ClickHouse database
54+
55+
Currently, this package doesn't support incremental materialization with ClickHouse. Please set
56+
`jitsu_model_materialized` to `table`
57+
58+
## Contributing
59+
Additional contributions to this repo are very welcome!

analysis/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)