-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Presto's from_unixtime with TSwTZ can be 1 millisecond off in Velox c…
…ompared to Presto Java (#11426) Summary: Pull Request resolved: #11426 from_unixtime with TSwTZ was written to reuse the logic used to implement the function for Timestamps. That is to say, it takes subtracts the seconds from the unixtime, multiplies the remainder by 1000, and rounds to get the integer number of milliseconds. The seconds and milliseconds are later recombined to form the unix timestamp portion of the TSwTZ. In Presto Java, for TSwTZ they simply multiply the unix timestamp by 1000 and round to get the unix timestamp portion of the TSwTZ. Due to the quirks of floating points, this means Presto Java and Velox can get slightly different answers. I modified Velox to reproduce the Presto Java logic for TSwTZ and confirmed this gives consistent results. Reviewed By: kgpai Differential Revision: D65434542 fbshipit-source-id: bfe434fe58103557dab72ff7a9309511460a1ae4
- Loading branch information
1 parent
f4a1223
commit 2ade7f7
Showing
3 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters