Skip to main content

Convert Column To Json

It lets the user convert MapType or Struct type to JSON string.

This transformation expects user to provide below inputs:

Input ArgumentsMandatoryDefault ValueDescription
column-nameYes-Name of the column which needs to be transformed

For example, consider we have below restonomer response in json:

{
"col_A": "1",
"col_B": [
{
"Zipcode": 704,
"ZipCodeType": "STANDARD"
}
]
}

Now, suppose the requirement is to transform col_B to json string:

Then, user can configure the ConvertColumnToJson transformation in the below manner:

{
type = "ConvertColumnToJson"
column-name = "col_B"
}

The transformed response will now have the columns with the desired data types:

{
"col_A": 1,
"col_B": "[{'ZipCodeType':'STANDARD','Zipcode':704}]"
}