-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-1032874: Fix an Overflow Issue for Integer-store Timestamp (#673)
According to https://docs.snowflake.com/en/sql-reference/functions/to_timestamp#usage-notes: - If the integer is less than 31536000000 (the number of milliseconds in a year), then the value is treated as a number of seconds. - If the value is greater than or equal to 31536000000 and less than 31536000000000, then the value is treated as milliseconds. - If the value is greater than or equal to 31536000000000 and less than 31536000000000000, then the value is treated as microseconds. - If the value is greater than or equal to 31536000000000000, then the value is treated as nanoseconds. Due to the multiplication logic in the code, we run into an overflow issue when the input is bigger than a certain value (for example: 31535999999999) and it causes silent corrupted values in the table, this change updates the code to use BigInteger instead of long to resolve the overflow issue.
- Loading branch information
1 parent
84420bf
commit a9ed16d
Showing
5 changed files
with
88 additions
and
18 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
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