I am trying to following custom transform in a wrangler in Google Cloud Data Fusion.
set-column column (parse-as-json :column 2 ) ? column =^ "[" : (parse-as-json :column 1 )
I want to parse column as JSON to a depth of 2 if it is an array, which means if it starts with a square bracket ([), otherwise to a depth of 1. I am not sure if the colon in parse-as-json
directive is causing issue here.
If I change it to following, it works fine:-
set-column column 'a' ? column =^ "[" : 'b'
I have also tried escaping the colon in parse-as-json
directive with a backslash,still didn't work. What am I doing wrong here? Please suggest.