An example of the problem is attached.
I have a JSON array, but I need to remove those with null values. When handling, a formatting error occurs. 87362496-98ea-4022-8dbc-4d52fa15c298.zip (7.8 KB)
All data are strings. I have attached the document that clearly demonstrates the problem I am facing. I just need to transform the “Array” field into JSON, but if there is a null field, it is a problem.
Follow the CSV in the attached example in ZIP. Example-Problem-JSON.zip (289 Bytes)
It looks like the double quotes in JSON string is not the right one, I replaced it with the right one and then you will hit the below error
UNSUPPORTED_OPERATION ERROR: Null values are not supported in lists by default. Please set store.json.all_text_mode to true to read lists containing nulls. Be advised that this will treat JSON null values as a string containing the word ‘null’.
Once you set that parameter, the query will work
SELECT oid_id, convert_fromJSON(“array”) JSON_aray FROM “Example-Problem-JSON 2”
But why does it always give an error when I try to treat the field I want to convert to JSON? For example, I would like to replace the [“null”] fields with empty. However, when doing this, Dremio returns me the following error:
Using CONVERT_FROM(*, ‘JSON’) is only supported against string literals and direct table references of types VARCHAR and VARBINARY.