-
Notifications
You must be signed in to change notification settings - Fork 223
Conversation
It's not backwards compatible, but it follows the ways as the modern number cast did. |
Codecov Report
@@ Coverage Diff @@
## main #254 +/- ##
==========================================
+ Coverage 77.31% 77.35% +0.03%
==========================================
Files 232 232
Lines 19949 20094 +145
==========================================
+ Hits 15424 15543 +119
- Misses 4525 4551 +26
Continue to review full report at Codecov.
|
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.
Makes sense. Thanks a lot. 4 observations:
- could you point me to somewhere describing "the ways as the modern number cast did."? (I feel I should read on that :))
- could we add a test for other cases (I think we need 4 csaes: (
ignore_overflow = true
andnot overflowing
,ignore_overflow = true
and overflowing, etc.) - For all cases where we up-cast (e.g.
i32 -> i64
), shouldn't we ignore the option and always hit the fast path since it is guaranteed to not overflow? - I wonder if the cast option could somehow follow an equivalent notation as Rust's own notation. If I understand correctly,
ignore_overflow
is equivalent to usingas
, which is equivalent to a saturating the cast
Emm, this is just c-style cast or default cast behavior in MySQL/ClickHouse. In c, cpp, rust, we use |
Co-authored-by: Jorge Leitao <jorgecarleitao@gmail.com>
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.
This last change was an awesome idea; it keeps it very clear (and even backward incompatible) 👍
Left some final minor comments, but the design is there.
Thanks a lot, @sundy-li , great work here!
Co-authored-by: Jorge Leitao <jorgecarleitao@gmail.com>
Not yet, we just depend on the performance of |
pulled locally and PRed minor changes. Sorry, with 2 I meant the two variations of the functions, not the 2 APIs, to keep it aligned with the other functions :) |
…dictionary_keys wrapping_dictionary_to_dictionary_values
fixes #252