Apache Drill
  1. Apache Drill
  2. DRILL-520

ceiling/ceil and floor functions return decimal value instead of an integer

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 1.0.0
    • Fix Version/s: Future
    • Component/s: Functions - Drill
    • Labels:
      None

      Description

      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.

        Issue Links

          Activity

          Tony Stevenson made changes -
          Workflow no-reopen-closed, patch-avail, testing [ 12860020 ] Drill workflow [ 12933583 ]
          Parth Chandra made changes -
          Fix Version/s Future [ 12326743 ]
          Fix Version/s 0.9.0 [ 12328813 ]
          Jacques Nadeau made changes -
          Priority Major [ 3 ] Critical [ 2 ]
          Fix Version/s 0.9.0 [ 12328813 ]
          Fix Version/s Future [ 12326743 ]
          Yash Sharma made changes -
          Assignee Yash Sharma [ yash360@gmail.com ] Mehant Baid [ mehant ]
          Yash Sharma made changes -
          Attachment DRILL-520.patch [ 12649644 ]
          Yash Sharma made changes -
          Assignee Jinfeng Ni [ jni ] Yash Sharma [ yash360@gmail.com ]
          Harold Dost III made changes -
          Link This issue is duplicated by DRILL-709 [ DRILL-709 ]
          Mehant Baid made changes -
          Fix Version/s Future [ 12326743 ]
          Mehant Baid made changes -
          Component/s Functions - Drill [ 12322695 ]
          Component/s Functions - Hive [ 12322687 ]
          Mehant Baid made changes -
          Component/s Functions - Hive [ 12322687 ]
          Jake Farrell made changes -
          Workflow no-reopen-closed, patch-avail [ 12855998 ] no-reopen-closed, patch-avail, testing [ 12860020 ]
          Jinfeng Ni made changes -
          Field Original Value New Value
          Assignee Jinfeng Ni [ jni ]
          Krystal created issue -

            People

            • Assignee:
              Mehant Baid
              Reporter:
              Krystal
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Development