dalongliu created FLINK-26949:
---------------------------------
Summary: Add NVL supported in SQL & Table API
Key: FLINK-26949
URL: https://issues.apache.org/jira/browse/FLINK-26949
Project: Flink
Issue Type: Sub-task
Components: Table SQL / API
Reporter: dalongliu
Fix For: 1.16.0
Returns {{expr2}} if {{expr1}} is {{{}NULL{}}}, or {{expr1}} otherwise.
Syntax:
{code:java}
nvl(expr1, expr2) {code}
Arguments:
* {{{}expr1{}}}: An expression of any type.
* {{{}expr2{}}}: An expression that shares a least common type with
{{{}expr1{}}}.
Reutrns:
The result type is the least common type of the argument types.
This function is a synonym for {{{}coalesce(expr1, expr2){}}}.
Examples:
{code:java}
> SELECT nvl(NULL, 2);
2
> SELECT nvl(3, 2);
3
{code}
See more:
* [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#nvl]
* [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf]
--
This message was sent by Atlassian Jira
(v8.20.1#820001)