Open jacobus-herman opened 2 weeks ago
We also found a duplicate in the seed file here. This is probably not intended.
I think this is the same issue as we see in Databricks after updatint to version 0.5.0.
This is the log from a failed run in Databricks:
Database Error in model snowplow_unified_sessions (models/sessions/snowplow_unified_sessions.sql) [DELTA_MULTIPLE_SOURCE_ROW_MATCHING_TARGET_ROW_IN_MERGE] Cannot perform Merge as multiple source rows matched and attempted to modify the same target row in the Delta table in possibly conflicting ways. By SQL semantics of Merge, when multiple source rows match on the same target row, the result may be ambiguous as it is unclear which source row should be used to update or delete the matching target row. You can preprocess the source table to eliminate the possibility of multiple matches.
Describe the bug
We receive an error when running the
snowplow_unified_sessions
model in Production on Snowflake. The error is as follows:This error seems to be due to be linked to the
mobile_language_name
column that was added and the fact that deduplication is only done forpostgres
andspark
but notsnowflake
.Steps to reproduce
Set the dbt_project.yml to the following:
Execute
dbt run --select package:snowplow_unified
.Expected results
Expected no errors from the
snowplow_unified_sessions
model.Actual results
Receiving an error:
Screenshots and log output
System information
The contents of your
packages.yml
file:Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using: macOS 15.0.1 (24A348) OR Debian Bookworm (python:3.9-slim Docker image)
The output of
python --version
: Python 3.9.19Additional context
Possible problem with line of code here: https://github.com/snowplow/dbt-snowplow-unified/blob/1223a5f9310ff5c215970309c4cedd766eaa1130/models/sessions/scratch/snowplow_unified_sessions_this_run.sql#L465 and here: https://github.com/snowplow/dbt-snowplow-unified/blob/1223a5f9310ff5c215970309c4cedd766eaa1130/models/sessions/scratch/snowplow_unified_sessions_this_run.sql#L485
Are you interested in contributing towards the fix?
Unfortunately, I have no time to do it directly.