0
votes

I am trying to query a mongodb collection with schema changes using apache drill, however I keep encountering this error

IllegalArgumentException: You tried to write a BigInt type when you are using a ValueWriter of type NullableIntWriterImpl.

Any ideas on how to fix this issue?

Sample Data in the mongo collection is:

_id : 4563 string code: 567438 string amount: 228218 int32 indicator : G string

The drill query is: select * from collection_name

1
mention sample data in the mongodb collection and drill query tried. - Dev
also share your MongoDB and Drill version - Dev

1 Answers

1
votes

Corrupted JSON records in MongoDB can cause this.

You can handle this using exec.enable_union_type option.

Fire query:

ALTER SYSTEM SET `exec.enable_union_type` = true;

Or go to http://localhost:8047/options (assuming drill is running on local machine replace with IP if not)

And change exec.enable_union_type to true.

This issue is explained in details at : http://www.dremio.com/blog/finding-corrupt-json-records-in-mongodb/