drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kristine Hahn (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (DRILL-2212) NULLIF function should be documented
Date Tue, 07 Apr 2015 01:49:12 GMT

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

Kristine Hahn resolved DRILL-2212.
----------------------------------
    Resolution: Fixed

Thanks for the info. Added a new section to cover this topic: http://drill.apache.org/docs/functions-for-handling-nulls/

> 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)

Mime
View raw message