Skip to content

Commit

Permalink
Merge pull request #1 from jitsucom/initial_commit
Browse files Browse the repository at this point in the history
Initial commit
  • Loading branch information
absorbb authored Jul 22, 2021
2 parents 30a3c4f + 87cfb9b commit f071e80
Show file tree
Hide file tree
Showing 18 changed files with 2,310 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea

target/
dbt_modules/
logs/
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# dbt-jitsu
This [dbt package](https://docs.getdbt.com/docs/package-management):
* Transforms pageviews into sessions
* For User stitching please enable builtin Jitsu feature [Retrospective User Recognition](https://jitsu.com/docs/other-features/retrospective-user-recognition)


## Installation instructions
New to dbt packages? Read more about them [here](https://docs.getdbt.com/docs/building-a-dbt-project/package-management/).
1. Include this package in your `packages.yml`
2. Run `dbt deps`
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**.

```YAML
# dbt_project.yml
config-version: 2
...

vars:
jitsu:
jitsu_events_table: "{{ source('jitsu', 'pageviews') }}" #or plane table path like database.schema.table_name

```

4. Optionally configure extra parameters by adding them to your own `dbt_project.yml` file – see [dbt_project.yml](dbt_project.yml)
for more details:

```YAML
# dbt_project.yml
config-version: 2

...

vars:
jitsu:
jitsu_events_table: "{{ source('jitsu', 'pageviews') }}"
jitsu_sessionization_trailing_window: 3
jitsu_session_inactivity_cutoff: 30 * 60
jitsu_pass_through_columns: ['event_type']
jitsu_model_materialized: incremental

```
5. Execute `dbt seed` -- this project includes a CSV that must be seeded for it
the package to run successfully.
6. Execute `dbt run` – the Jitsu Sessions models will get built

## Database support
This package has been tested on
PostgreSQL, ClickHouse, Redshift and BigQuery.

### ClickHouse implementation details
This package relies heavily on SQL window functions.
Because Window functions are considered as an [experimental feature in ClickHouse](https://clickhouse.tech/docs/en/sql-reference/window-functions/)
we cannot guarantee stable results of using this package with ClickHouse database

Currently, this package doesn't support incremental materialization with ClickHouse. Please set
`jitsu_model_materialized` to `table`

## Contributing
Additional contributions to this repo are very welcome!
Empty file added analysis/.gitkeep
Empty file.
Loading

0 comments on commit f071e80

Please sign in to comment.