Skip to content

Fix!: use string func in surrogate key macro (only md5 at the moment)#3448

Merged
georgesittas merged 1 commit intomainfrom
jo/surrogate_key_fixes
Dec 3, 2024
Merged

Fix!: use string func in surrogate key macro (only md5 at the moment)#3448
georgesittas merged 1 commit intomainfrom
jo/surrogate_key_fixes

Conversation

@georgesittas
Copy link
Contributor

@georgesittas georgesittas commented Dec 2, 2024

The dialect argument in the exp.func call can lead to incorrect AST generation. For instance, prior to this PR we'd generate MD5 in BigQuery, which returns a BYTES value.

The long term plan for improving this macro is to properly support other hash functions is to add them in SQLGlot (e.g. SHA256Digest). I omitted this change because we can do it incrementally, fixing MD5 is higher ROI.

@georgesittas georgesittas requested a review from a team December 2, 2024 15:27
@georgesittas georgesittas force-pushed the jo/surrogate_key_fixes branch from 843c05f to 3e8029f Compare December 3, 2024 12:27
@georgesittas georgesittas merged commit a37bb6d into main Dec 3, 2024
@georgesittas georgesittas deleted the jo/surrogate_key_fixes branch December 3, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants