Using of non-existence field as parameter (or field with null values across a whole batch) of CONVERT_TO_JSON function leads to failure.
The root cause of the issue and fix:
If there isn't a particular vector for the field, "NullExpression" is created as an argument for the Drill function. That argument can be replaced later in "ExpressionTreeMaterializer.visitFunctionCall()" with "TypedNullConstant" logical expression, but LATE type shouldn't be used for this case, the data type of the field is still unknown.
Note: the issue is reproduced not only for json (for example mongo or mapr-db json tables have the same issue)