The MinorType.NULL check is required for handling cases where there can be a 
function with a null argument. This can happen, for instance, in 
convert_to_JSON like in TestComplexTypeReader testNonExistentFieldConverting() 
when trying to convert a non existent field.
See below for the object graph.

this = {DrillFuncHolderExpr@8281} 
 holder = {DrillSimpleFuncHolder@8279} "DrillSimpleFuncHolder 
[functionNames=[convert_toJSON, convert_toSIMPLEJSON], 
returnType=MajorType[minor_type: VARBINARY mode: REQUIRED], 
nullHandling=NULL_IF_NULL, parameters=[ValueReference 
[type=MajorType[minor_type: LATE mode: REQUIRED], name=input]]]"
 majorType = {TypeProtos$MajorType@8317} "minor_type: VARBINARY\nmode: 
OPTIONAL\n"
 interpreter = null
 args = {SingletonImmutableList@8315}  size = 1
  0 = {NullExpression@8285} 
   t = {TypeProtos$MajorType@8287} "minor_type: NULL\nmode: OPTIONAL\n"
 nameUsed = "convert_tojson"
 fieldReference = null
 pos = {ExpressionPosition@8322} 
"org.apache.drill.common.expression.ExpressionPosition@748c42c3[charIndex = -1, 
expression = --UNKNOWN EXPRESSION--]"

[ Full content available at: https://github.com/apache/drill/pull/1442 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to