Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-27035][SQL] Get more precise current time
## What changes were proposed in this pull request? In the PR, I propose to replace `System.currentTimeMillis()` by `Instant.now()` in the `CurrentTimestamp` expression. `Instant.now()` uses the best available clock in the system to take current time. See [JDK-8068730](https://bugs.openjdk.java.net/browse/JDK-8068730) for more details. In JDK8, `Instant.now()` provides results with millisecond resolution but starting from JDK9 resolution of results is increased up to microseconds. ## How was this patch tested? The changes were tested by `DateTimeUtilsSuite` and by `DateFunctionsSuite`. Closes apache#23945 from MaxGekk/current-time. Authored-by: Maxim Gekk <[email protected]> Signed-off-by: Sean Owen <[email protected]>
- Loading branch information