Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Duplicating session_number in incremental materializations #80

Closed
1 of 5 tasks
rjh336 opened this issue Feb 25, 2022 · 0 comments · Fixed by #81
Closed
1 of 5 tasks

Duplicating session_number in incremental materializations #80

rjh336 opened this issue Feb 25, 2022 · 0 comments · Fixed by #81
Labels
bug Something isn't working

Comments

@rjh336
Copy link
Contributor

rjh336 commented Feb 25, 2022

Describe the bug

There was an issue introduced in #73 in the updated segment_web_sessions model here where the comparison operator was flipped in the agg CTE for incremental materializations. The result is that session_number starts to get repeated for newly added sessions which we do not want.

Steps to reproduce

  1. dbt run to MERGE to existing tables
  2. check segment_web_sessions output and you will see new web sessions start counting from 1 instead of the last known session_number for each blended user ID

Expected results

session_number is incremented over a user's sessions

Actual results

duplicate session numbers for each user on incremental runs

Screenshots and log output

System information

The contents of your packages.yml file:

packages:
  - package: dbt-labs/segment
    version: 0.8.0
  - package: dbt-labs/audit_helper
    version: 0.5.0
  - package: dbt-labs/stitch_utils
    version: 0.4.1
  - package: dbt-labs/dbt_utils
    version: 0.8.0
  - package: dbt-labs/dbt_external_tables
    version: 0.8.0

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

installed version: 1.0.3
   latest version: 1.0.3

Up to date!

Plugins:
  - bigquery: 1.0.0 - Up to date!
  - snowflake: 1.0.0 - Up to date!
  - redshift: 1.0.0 - Up to date!
  - postgres: 1.0.3 - Up to date!

The operating system you're using: MacOS

The output of python --version: Python 3.8.11

Additional context

Are you interested in contributing the fix?

@rjh336 rjh336 added the bug Something isn't working label Feb 25, 2022
@joellabes joellabes linked a pull request Mar 7, 2022 that will close this issue
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant