[ 
https://issues.apache.org/jira/browse/DRILL-2212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Victoria Markman closed DRILL-2212.
-----------------------------------

> NULLIF function should be documented
> ------------------------------------
>
>                 Key: DRILL-2212
>                 URL: https://issues.apache.org/jira/browse/DRILL-2212
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 0.8.0
>            Reporter: Victoria Markman
>            Assignee: Kristine Hahn
>
> NULLIF ( expression , expression )
> Arguments: any valid scalar expression
> Return Types: returns the same type as the first expression.
> NULLIF returns the first expression if the two expressions are not equal. 
> If the expressions are equal, NULLIF returns a null value of the type of the 
> first expression.
> {code}
> 0: jdbc:drill:schema=dfs> select d9, d18 from alltypes limit 1;
> +------------+------------+
> |     d9     |    d18     |
> +------------+------------+
> | 1032.65    | 1032.6516  |
> +------------+------------+
> 1 row selected (0.081 seconds)
> 0: jdbc:drill:schema=dfs> select nullif(d9, d18) from alltypes limit 1;
> +------------+
> |   EXPR$0   |
> +------------+
> | 1032.65    |
> +------------+
> 1 row selected (0.079 seconds)
> 0: jdbc:drill:schema=dfs> select nullif(d9, d9) from alltypes limit 1;
> +------------+
> |   EXPR$0   |
> +------------+
> | null       |
> +------------+
> 1 row selected (0.083 seconds)
> 0: jdbc:drill:schema=dfs> select nullif(round(d9), trunc(d9)) from alltypes 
> limit 1;
> +------------+
> |   EXPR$0   |
> +------------+
> | 1033       |
> +------------+
> 1 row selected (0.094 seconds)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to