You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Victoria Markman (JIRA)" <ji...@apache.org> on 2015/02/11 19:44:12 UTC

[jira] [Created] (DRILL-2212) NULLIF function should be documented

Victoria Markman created DRILL-2212:
---------------------------------------

             Summary: 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
            Reporter: Victoria Markman
            Assignee: Bridget Bevens


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)