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

Charles Givre commented on DRILL-7345:
--------------------------------------

So, let's say we have a UDF called foo(x) which returns a list.  Let's say our 
data looks like this:  [2,4,5,null,8]

Are you saying that for that to work, I'd have to create an additional UDF with 
nullable input that returns an empty list or something like that?  Would that 
return an additional column or would the result be in the same column?
Thanks,
-- C




> Strange Behavior for UDFs with ComplexWriter Output
> ---------------------------------------------------
>
>                 Key: DRILL-7345
>                 URL: https://issues.apache.org/jira/browse/DRILL-7345
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.17.0
>            Reporter: Charles Givre
>            Priority: Minor
>
> I wrote some UDFs recently and noticed some strange behavior when debugging 
> them. 
> This behavior only occurs when there is ComplexWriter as output.  
> Basically, if the input to the UDF is nullable, Drill doesn't recognize the 
> UDF at all.  I've found that the only way to get Drill to recognize UDFs that 
> have ComplexWriters as output is:
> * Use a non-nullable holder as input
> * Remove the null setting completely from the function parameters.
> This approach has a drawback in that if the function receives a null value, 
> it will throw an error and halt execution.  My preference would be to allow 
> null handling, but I've not figured out how to make that happen.
> Note:  This behavior ONLY occurs when using a ComplexWriter as output.  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to