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

Current time with microsecond resolution

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.0
    • Fix Version/s: 3.0.0
    • Component/s: SQL
    • Labels:
    • Docs Text:
      Hide
      In Spark version 2.4 and earlier, the `current_timestamp` function returns a timestamp with millisecond resolution only. Since Spark 3.0, the function can return the result with microsecond resolution if the underlying clock available on the system offers such resolution.
      Show
      In Spark version 2.4 and earlier, the `current_timestamp` function returns a timestamp with millisecond resolution only. Since Spark 3.0, the function can return the result with microsecond resolution if the underlying clock available on the system offers such resolution.

      Description

      Currently,  the CurrentTimestamp expression uses System.currentTimeMillis() to take current time with millisecond resolution. The Instant.now allows potentially to take current time with microsecond resolution: https://bugs.openjdk.java.net/browse/JDK-8068730 . The ticket aims to replace System.currentTimeMillis() by Instant.now().

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                maxgekk Maxim Gekk
                Reporter:
                maxgekk Maxim Gekk
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: