Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-10866

[Spark SQL] [UDF] the floor function got wrong return value type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.0
    • 1.6.0
    • SQL
    • None

    Description

      As per floor definition,it should get BIGINT return value
      -floor(DOUBLE a)
      -Returns the maximum BIGINT value that is equal to or less than a.

      But in current Spark implementation, it got wrong value type.
      e.g.,
      select floor(2642.12) from udf_test_web_sales limit 1;
      2642.0

      In hive implementation, it got return value type like below:
      hive> select ceil(2642.12) from udf_test_web_sales limit 1;
      OK
      2642

      Attachments

        Issue Links

          Activity

            People

              chenghao Cheng Hao
              jameszhouyi Yi Zhou
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: