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

Difference in results of casting float to timestamp

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.1.2, 3.2.0
    • Component/s: SQL
    • Labels:

      Description

      The code below portraits the issue:

      spark-sql> CREATE TEMP VIEW v1 AS SELECT 16777215.0f AS f;
      spark-sql> SELECT * FROM v1;
      1.6777215E7
      spark-sql> SELECT CAST(f AS TIMESTAMP) FROM v1;
      1970-07-14 07:20:15
      spark-sql> CACHE TABLE v1;
      spark-sql> SELECT * FROM v1;
      1.6777215E7
      spark-sql> SELECT CAST(f AS TIMESTAMP) FROM v1;
      1970-07-14 07:20:14.951424
      

      The result from the cached view 1970-07-14 07:20:14.951424 is different from un-cached view 1970-07-14 07:20:15.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                maxgekk Max Gekk
                Reporter:
                maxgekk Max Gekk
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: