-
Notifications
You must be signed in to change notification settings - Fork 875
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
Arrow Cast: Fixed Point Arithmetic for Interval Parsing #4291
Conversation
Thank you for this, I realise the issue I filed did you a disservice as it was perhaps a touch underspecified. I think this PR would be dramatically simplified if instead of implementing variable FixedPoint arithmetic as this PR does, instead did something along the lines of
Where the precision is fixed. This is not only less code but avoids expensive integer division and modulus operations, which are by far the slowest arithmetic operations on modern processors, with LLVM automatically converting division by a constant to a fixed point multiplication. It also allows eliding some overflow checks, as the fractional component must be less than |
Apologies for the confusion on my part. I really appreciate the clarification and your patience. Will have this PR updated by the weekend. |
I'm marking this as draft to make it clear that it isn't waiting for a review imminently. Please feel free to mark it ready for review when you'd like me to take another look 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, looks good to me 👍
FWI I believe this PR introduced a regression: #4424 (comment) |
Which issue does this PR close?
Closes #3809
Rationale for this change
See #3809
What changes are included in this PR?
IntervalType
toIntervalUnit
to disambiguate with interval precision types (e.g.,MonthDayNanos
,YearMonths
)IntervalUnit
w/ trait implementation for string parsingInterval
with methods for parsing, adding, and converting to other interval typesparse_interval_components
function for parsing interval strings into amount/unit pairsIntervalParseConfig
to house future configuration options we may want to add to interval parsingAre there any user-facing changes?
cast.rs
)