Home > Software engineering >  Azure Data Flow Flatten and Parsing key/value column
Azure Data Flow Flatten and Parsing key/value column

Time:10-25

I'm trying to transform a key/value data into column using Azure Data Flow. Basically this:

{"key":"rate1","value":"123"}-{"key":"rate2","value":"456"}

into this:

key value
rate1 123
rate2 456

I was following this example here ( Flatten and Parsing Json using Azure Data Flow ), and everything was look good until I tried to use parse.

The output just shows the value column, not the key. I don't know why. Below are my dataflow settings.

Source query: https://i.stack.imgur.com/6Q8Xb.png

Source Data preview: https://i.stack.imgur.com/UNj8x.png

Derived Column: https://i.stack.imgur.com/C0g1N.png

Derived Column Data preview: https://i.stack.imgur.com/vtVY7.png

Flatten: https://i.stack.imgur.com/Bkp7P.png

Flatten Data preview: https://i.stack.imgur.com/yM6h1.png

Parse: https://i.stack.imgur.com/RUJpr.png

Parse Data preview: https://i.stack.imgur.com/RC42Y.png

Anyone have any idea what I'm missing?

Edit: My source is Snowflake

Thanks in advance!

CodePudding user response:

I reproduced the above and got same result after parse transformation.

enter image description here

The above process is correct, may be the preview is not showing correctly. You can view the desired result as individual columns by using derived column transformation after parse.

enter image description here

In sink select the desired columns by Mapping->deselect auto mapping-> ->Fixed mapping.

enter image description here

Sink Data preview:.

enter image description here

  • Related