See all drill best practice FAQs.
When reading a JSON file, Drill tries to determine the data type of a column based on the first batch (4096 rows). If a column has null values for all rows in this batch, Drill will by default read it as a nullable integer. This can lead to the following error if the actual data type happens to be something else that is not compatible with integer: 'Error: DATA_READ ERROR: Error parsing JSON - You tried to write a VarChar type when you are using a ValueWriter of type NullableIntWriterImpl.'
Then re-run your query. Note that the all_text_mode is not as efficient as reading the data as its native type; however the goal here is to be able to do data exploration first so the trade-off may be acceptable. Also, doing this on a per session basis (using the alter session) limits the scope to a particular session.
Retrieving data ...