Redshift json_serialize double quotes

Viewed 228

I am ingesting (COPY) json data from S3.
Initially storing in a single SUPER column, and then extracting out the individual attributes into a normalised table/columns with the usual datatypes for each (varchar, integer etc..)

My problem is with this

json_serialize("json"."myattribute") as "mycolumn"

the resultant values are coming out with the original json double quote wrapping

"apples"

where I want just

apples

of course I could do a 'replace', but still hoping that there might be a simple way to extract without the quotes in the first place ?

Thanks

1 Answers

assuming "json" is a column with super type:
json.myattribute returns super type, that's why you see double quotes.
try this json.myattribute::varchar.
it returns character without quotes.

Related