You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Yash Sharma (JIRA)" <ji...@apache.org> on 2014/06/14 20:18:01 UTC
[jira] [Commented] (DRILL-520) ceiling/ceil and floor functions
return decimal value instead of an integer
[ https://issues.apache.org/jira/browse/DRILL-520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14031644#comment-14031644 ]
Yash Sharma commented on DRILL-520:
-----------------------------------
It is safer to return the datatype type similar to that of passed input type to avoid loss of data on conversion to long/int.
Fix: Future
> ceiling/ceil and floor functions return decimal value instead of an integer
> ---------------------------------------------------------------------------
>
> Key: DRILL-520
> URL: https://issues.apache.org/jira/browse/DRILL-520
> Project: Apache Drill
> Issue Type: Bug
> Components: Functions - Drill
> Affects Versions: 1.0.0
> Reporter: Krystal
> Assignee: Yash Sharma
> Fix For: Future
>
> Attachments: DRILL-520.patch
>
>
> Ran the following queries in drill:
> 0: jdbc:drill:schema=dfs> select ceiling(55.8) from dfs.`student` where rownum=11;
> +------------+
> | EXPR$0 |
> +------------+
> | 56.0 |
> +------------+
> 0: jdbc:drill:schema=dfs> select floor(55.8) from dfs.`student` where rownum=11;
> +------------+
> | EXPR$0 |
> +------------+
> | 55.0 |
> +------------+
> The same queries executed from oracle, postgres and mysql returned integer values of 56 and 55.
> Found the following description of the two functions from http://users.atw.hu/sqlnut/sqlnut2-chp-4-sect-4.html :
> Ceil/Ceiling:
> Rounds a noninteger value upwards to the next greatest integer. Returns an integer value unchanged.
> Floor:
> Rounds a noninteger value downwards to the next least integer. Returns an integer value unchanged.
--
This message was sent by Atlassian JIRA
(v6.2#6252)