Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Multiple column to a new column and it's value in should be merged to give a json

Highlighted

Multiple column to a new column and it's value in should be merged to give a json

New Contributor

I have a csv input file it contains many columns I want to group them and and create a new column from that and it's value of corresponding columns in json format.

Below is a sample

csv input :


resourceTags/user:Name,resourceTags/user:application,resourceTags/user:assetid,resourceTags/user:env,resourceTags/user:layer,
name_1, application_1, assetid_1, env_1,layer_1

CSV output expected


column name = resourceTags_USER

Column value = {

Name : name_1,
application:application_1,

"assetid":assetid_1,
"env":env_1,
"layer":layer_1
}

Thanks in advance for your help.
It will be helpful if dynamically this can be handled by regex.