Exploding Array Scrambles ID Column

Whenever I use the explode array function, all the columns remain mapped properly except for my id column, which is a SHA256 of a UUID. Exploding my array will create a column with a totally new set of IDs, which are replicated accordingly. I need to preserve the original IDs. What am I doing wrong?

Hi,

Please could you add some more info about the schema of your data? Are you trying to explode an array of strings containing these hashes? What is the output you’re looking for?

Hi Ben,

I believe I debugged this myself, and it’s a bit strange! I was using a SHA256 hash of a UUID to generate (what I thought was) a fail-proof unique hash for each id. It turns out that UUIDs were the culprit, and that when the row values changed, the id changed as well. I even tried copying the column over to preserve the metadata, but that did not work.

The moral of the story is that UUIDs are unstable (as indicated in the warning you get when you try to use them).

Thank you!

1 Like