You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Krystal (JIRA)" <ji...@apache.org> on 2014/05/27 19:22:01 UTC

[jira] [Commented] (DRILL-708) TRUNC(n1) function returns a decimal instead of int

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

Krystal commented on DRILL-708:
-------------------------------

git.commit.id.abbrev=5b8f8d8

Same issue seen for ROUND(n) or ROUND(n, decimal).


select name, round(134.45,0) from voter where voter_id=10;
+------------+------------+
|    name    |   EXPR$1   |
+------------+------------+
| [B@5591a832 | 134.0      |
+------------+------------+

0: jdbc:drill:schema=dfs> select name, round(134.45) from voter where voter_id=10;
+------------+------------+
|    name    |   EXPR$1   |
+------------+------------+
| [B@6b7b36f6 | 134.0      |

In oracle and postgres, both return an int (134) for the above queries.

> TRUNC(n1) function returns a decimal instead of int
> ---------------------------------------------------
>
>                 Key: DRILL-708
>                 URL: https://issues.apache.org/jira/browse/DRILL-708
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>    Affects Versions: 1.0.0-milestone-1
>            Reporter: Krystal
>
> The TRUNC(n1) function should return the integer part of n1 as an int.  In drill, however, the value returned is a decimal.  For example,
> select trunc(15.79) from voter where voter_id=10;
> returns 15.0
> The other database platforms return an int value of 15.



--
This message was sent by Atlassian JIRA
(v6.2#6252)