[VARIANT_SIZE_LIMIT] Cannot build variant bigger than 16.0 MiB in parse_json

bbastian
New Contributor

I have a table coming from postgreSql, with one column containing json data in string format. We have been using parse_json to convert that to a vraiant column. But lately it is failing with the SIZE_LIMIT error. 

When I isolated the row which gave error, the json string contains a an array of 75 items (with four fields each). when I  saved that data column as a text/json file it takes only 30 kb (disk space) .When I tried from_json function with a pre defined schema , I was successfully able to convert to a StructType column.

We like to keep the column as Variant, as we don't want it tied to a specific schema. Any suggestions.