[ 
https://issues.apache.org/jira/browse/DRILL-6810?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16661119#comment-16661119
 ] 

Paul Rogers commented on DRILL-6810:
------------------------------------

Disabling of {{NULL_IF_NULL}} handling may lead to unexpected behavior: the UDF 
writer things Drill will do it, Drill thinks the UDF writer will do it.

Better would be to fail to load the function if it has a complex writer and 
requests {{NULL_IF_NULL}} handling.

Even better is to extend handling to correctly handle complex types. The rules 
are simple (if a bit hard to implement):

* Arrays are set to zero length. (This must be done explicitly to ensure that 
the offset vector entry is created.)
* Recurse into map members.
* Each map member must be nullable. If not, we can't set it to null. Either 
fail the query, or punt and set the non-nullable field to a default value (0 or 
"").
* For each nullable member, no need to do anything: Drill's fill-empties logic 
will handle the case.

> Disable NULL_IF_NULL NullHandling for functions with ComplexWriter
> ------------------------------------------------------------------
>
>                 Key: DRILL-6810
>                 URL: https://issues.apache.org/jira/browse/DRILL-6810
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.14.0
>            Reporter: Bohdan Kazydub
>            Assignee: Bohdan Kazydub
>            Priority: Major
>             Fix For: 1.15.0
>
>
> Currently NullHandling.NULL_IF_NULL is allowed for UDFs with @Output of type 
> org.apache.drill.exec.vector.complex.writer.BaseWriter.ComplexWriter but no 
> null handling is performed for the kind of functions which leads to 
> confusion. The problem is ComplexWriter holds list/map values and Drill does 
> not yet support NULL values for the types (there is an issue to allow null 
> maps/lists in [DRILL-4824|https://issues.apache.org/jira/browse/DRILL-4824]).
> For such functions support for NULL_IF_NULL will be disabled, as it is done 
> for aggregate functions, and NullHandling.INTERNAL should be used instead.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to