-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C#] TimestampArray.ConvertTo() returns erroneous value for large ticks when returning nanoseconds #37377
Comments
westonpace
pushed a commit
that referenced
this issue
Sep 27, 2023
…ConvertTo() (#37388) Throw `OverflowException` on overflow in `TimestampArray.ConvertTo()` when `DataType.Unit` is `Nanosecond` and `ticks` is large, instead of silently overflowing and returning the wrong value. * Closes: #37377 Authored-by: Danyaal Khan <danyaal99@hotmail.co.uk> Signed-off-by: Weston Pace <weston.pace@gmail.com>
etseidl
pushed a commit
to etseidl/arrow
that referenced
this issue
Sep 28, 2023
…Array.ConvertTo() (apache#37388) Throw `OverflowException` on overflow in `TimestampArray.ConvertTo()` when `DataType.Unit` is `Nanosecond` and `ticks` is large, instead of silently overflowing and returning the wrong value. * Closes: apache#37377 Authored-by: Danyaal Khan <danyaal99@hotmail.co.uk> Signed-off-by: Weston Pace <weston.pace@gmail.com>
JerAguilon
pushed a commit
to JerAguilon/arrow
that referenced
this issue
Oct 23, 2023
…Array.ConvertTo() (apache#37388) Throw `OverflowException` on overflow in `TimestampArray.ConvertTo()` when `DataType.Unit` is `Nanosecond` and `ticks` is large, instead of silently overflowing and returning the wrong value. * Closes: apache#37377 Authored-by: Danyaal Khan <danyaal99@hotmail.co.uk> Signed-off-by: Weston Pace <weston.pace@gmail.com>
loicalleyne
pushed a commit
to loicalleyne/arrow
that referenced
this issue
Nov 13, 2023
…Array.ConvertTo() (apache#37388) Throw `OverflowException` on overflow in `TimestampArray.ConvertTo()` when `DataType.Unit` is `Nanosecond` and `ticks` is large, instead of silently overflowing and returning the wrong value. * Closes: apache#37377 Authored-by: Danyaal Khan <danyaal99@hotmail.co.uk> Signed-off-by: Weston Pace <weston.pace@gmail.com>
dgreiss
pushed a commit
to dgreiss/arrow
that referenced
this issue
Feb 19, 2024
…Array.ConvertTo() (apache#37388) Throw `OverflowException` on overflow in `TimestampArray.ConvertTo()` when `DataType.Unit` is `Nanosecond` and `ticks` is large, instead of silently overflowing and returning the wrong value. * Closes: apache#37377 Authored-by: Danyaal Khan <danyaal99@hotmail.co.uk> Signed-off-by: Weston Pace <weston.pace@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug, including details regarding any error messages, version, and platform.
TimestampArray.ConvertTo()
can return an erroneous value whenticks
is large (both positive and negative) andDataType.Unit
isNanosecond
, due to an overflow silently occurring when multiplying ticks.This could be replaced with an explicit error, by returning an
OverflowException
on overflow. C# doesn't check for overflows by default, but this can be enabled by performing the calculation in achecked
operation.However, this could lead to a breaking change, as it would require the explicit handling of errors when overflows occur when building a timestamp array. But this would mean all occurrences of this error will be explicit, instead of silently producing bad data.
Component(s)
C#
The text was updated successfully, but these errors were encountered: