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

Hequn Cheng commented on FLINK-10049:
-------------------------------------

[~xccui] Thanks for opening the issue. Good catch and +1 to unify the 
processing logic.

This is an interesting topic and I would like to share some thoughts too. I 
think it's a big topic for the improvement of UDF which deserves a discussion 
by itself.

As for the null input problem raised by this issue, I have come up with two 
problems to be addressed.
 - How to handle Exceptions for UDF.
We may need a global configuration to control the behavior of handling 
exceptions for UDF. For example, providing a return null option.
 - How to handle NULL input and NULL output.
We can let the UDF process null input by default. However, we can also provide 
options like SqlServer, i.e., {{RETURNS NULL ON NULL INPUT}}, return NULL when 
any of the arguments it receives is NULL, without actually invoking the body of 
the function.

What do you guys think?
 

> Unify the processing logic for NULL arguments in SQL built-in functions
> -----------------------------------------------------------------------
>
>                 Key: FLINK-10049
>                 URL: https://issues.apache.org/jira/browse/FLINK-10049
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / API
>            Reporter: Xingcan Cui
>            Assignee: vinoyang
>            Priority: Major
>
> Currently, the built-in functions treat NULL arguments in different ways. 
> E.g., ABS(NULL) returns NULL, while LOG10(NULL) throws an NPE. The general 
> SQL-way of handling NULL values should be that if one argument is NULL the 
> result is NULL. We should unify the processing logic for that.



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

Reply via email to