DRILL-836: [addendum] Drill needs to return complex types (e.g., map and array) as a JSON string
* This contains additional changes to the original patch which was merged.
+ Renamed "flatten" to "complex-to-json"
+ With the new patch, we return VARCHAR instead of VARBINARY.
+ Added test case.
+ Minor code re-factoring.