06-18-2021 02:03 PM
I am working on a Snaplogic pipeline to copy data from Oracle to Snowflake. A few tables at source have BLOB column which needs to be copied. Snaplogic sees them as “Base64 encoded data” but Snowflake needs the data in HEX format. I would like to know if its possible to convert the data as required and load into Snowflake tables. I’ve attached a sample pipeline.
TEST_2021_06_18.slp (7.1 KB)
06-21-2021 03:20 AM
Hi @ADORAISWAMY ,
There is an irregular mapping in your sample pipeline,
This way you are mapping a target path. If you are trying to encode the CONTENT in Base64 format, you should set the mapping like this:
06-21-2021 09:26 AM
Hi Bojan,
Thank you for responding. Since I am converting from base64 to HEX, I need to use “base64.decode” function. But that doesn’t seem to work. I have attached the error.
Appreciate your help.
06-21-2021 11:08 AM
Bojan,
I am not sure what Snaplogic is trying to tell me here. One one hand, the output view from the Oracle SELECT shows the data as “base64 encided data”…
But again, when I try to decode the data in the mapper snap, it says the data is not a valid base64 data, which is contradictory…
Can you please advise a course of action ? Thanks.
06-21-2021 04:30 PM
I’m afraid the SnapLogic UI is rather misleading here. When you see “Base64 encoded data” for a field’s content in the preview output, it really means that the field contains binary data (an array of bytes). If it were really Base64 encoded data, you would just see a string containing the Base64 encoding of the binary data. I think this is because the UI is reflecting the representation of the preview data it’s getting from the control plane, rather than the actual raw data being passed between snaps.
So, the $CONTENT field from Oracle is the binary data itself – a byte array. How were you planning on hex-encoding that? I don’t believe that our expression language provides a hex encoding function similar to the Base64.encode() function it provides.