Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 6.1.4 #1374

Merged
merged 2 commits into from
Jan 22, 2025
Merged

Release 6.1.4 #1374

merged 2 commits into from
Jan 22, 2025

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 22, 2025

Jira ref: PDP-1669
Created by Github Actions

Scenario:

* Input batch contains data using schema, let’s say link_click
* link_click schema is used as a context AND as an entity/self describing event
* We have multiple versions of  link_click schema

When translated to the content of shredding_complete JSON message, it would contain Iines like this:
```
      "types": [
        {
          "schemaKey": "iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-0",
          "snowplowEntity": "SELF_DESCRIBING_EVENT"
        },
        ....
        {
          "schemaKey": "iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1",
          "snowplowEntity": "CONTEXT"
        }
      ]
```

For such scenario it looks like we skip necessary warehouse migration for self describing column. We only execute migration for the context:

```
INFO Migration: Migrating contexts_com_snowplowanalytics_snowplow_link_click_1 AddColumn(Fragment("ALTER TABLE atomic.events ADD COLUMN contexts_com_snowplowanalytics_snowplow_link_click_1 ARRAY"),List()) (pre-transaction)
```
but never for unstruct_event_com_snowplowanalytics_snowplow_link_click_1, which results in an error when inserting data to the table:

```
ERROR Error executing transaction. Sleeping for 30 seconds for the first time
net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error: error line 1 at position 1,779
invalid identifier 'UNSTRUCT_EVENT_COM_SNOWPLOWANALYTICS_SNOWPLOW_LINK_CLICK_1'
```

It seems to be caused by this [line](https://github.com/snowplow/snowplow-rdb-loader/blob/fffcbe460d7960714116aa7fe606a5ffbb4fd31d/modules/loader/src/main/scala/com/snowplowanalytics/snowplow/rdbloader/discovery/DataDiscovery.scala#L213) where we group incoming types by the name and find max schema key per group. But name doesn’t contain unstruct/context prefix, so it’s possible to “lose” type when schema is used as both context/unstruct + with older version.

I think the solution here could be using full type name instead of simple short name. Full name takes into account if it’s context/unstruct, still groups types, but with additional prefix.
@snowplowcla
Copy link
Collaborator

Thanks for your pull request. Is this your first contribution to a Snowplow open source project? Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://docs.snowplowanalytics.com/docs/contributing/contributor-license-agreement/ to learn more and sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.

@pondzix pondzix merged commit 0512ecb into master Jan 22, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants