Skip to content
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

Add int128 and supported functions #2096

Merged
merged 1 commit into from
Oct 24, 2023
Merged

Add int128 and supported functions #2096

merged 1 commit into from
Oct 24, 2023

Conversation

Ashleyhx
Copy link
Contributor

No description provided.

@Ashleyhx Ashleyhx force-pushed the ashleyhx/add-hugeint branch 2 times, most recently from b484bf9 to ea1531c Compare October 3, 2023 20:40
Copy link
Collaborator

@acquamarin acquamarin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some test cases to cast_error.test where the casting fails?

src/CMakeLists.txt Outdated Show resolved Hide resolved
src/common/types/int128_t.cpp Show resolved Hide resolved
src/include/c_api/kuzu.h Outdated Show resolved Hide resolved
src/include/function/cast/numeric_cast.h Outdated Show resolved Hide resolved
src/include/function/cast/numeric_cast.h Outdated Show resolved Hide resolved
src/include/function/cast/numeric_limits.h Outdated Show resolved Hide resolved
test/test_files/tinysnb/projection/single_label.test Outdated Show resolved Hide resolved
@Ashleyhx Ashleyhx force-pushed the ashleyhx/add-hugeint branch 5 times, most recently from 93c3230 to 9270191 Compare October 11, 2023 02:45
@Ashleyhx Ashleyhx marked this pull request as ready for review October 11, 2023 02:48
@Ashleyhx Ashleyhx force-pushed the ashleyhx/add-hugeint branch 6 times, most recently from 4b5b208 to 63eab31 Compare October 16, 2023 20:34
@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

Attention: 67 lines in your changes are missing coverage. Please review.

Comparison is base (5d7ad00) 89.71% compared to head (f2171c0) 89.62%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2096      +/-   ##
==========================================
- Coverage   89.71%   89.62%   -0.09%     
==========================================
  Files        1014     1017       +3     
  Lines       35859    35856       -3     
==========================================
- Hits        32171    32137      -34     
- Misses       3688     3719      +31     
Files Coverage Δ
src/common/type_utils.cpp 86.41% <100.00%> (+0.34%) ⬆️
src/common/types/types.cpp 0.00% <ø> (-90.83%) ⬇️
src/common/vector/value_vector.cpp 91.96% <100.00%> (+0.12%) ⬆️
src/function/aggregate_function.cpp 88.00% <100.00%> (+0.76%) ⬆️
src/function/comparison_functions.cpp 91.46% <100.00%> (+0.10%) ⬆️
src/function/vector_cast_functions.cpp 81.15% <100.00%> (+0.70%) ⬆️
src/function/vector_hash_functions.cpp 90.47% <100.00%> (+0.47%) ⬆️
src/include/common/exception/overflow.h 100.00% <100.00%> (ø)
src/include/common/string_utils.h 80.00% <ø> (ø)
src/include/common/type_utils.h 100.00% <100.00%> (ø)
... and 33 more

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@acquamarin acquamarin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also fix the CI and compilation issue on mac?

CMakeLists.txt Outdated Show resolved Hide resolved
src/function/vector_list_functions.cpp Show resolved Hide resolved
src/include/c_api/kuzu.h Outdated Show resolved Hide resolved
src/include/common/int128_t.h Show resolved Hide resolved
src/include/common/int128_t.h Show resolved Hide resolved
src/parser/transform/transform_expression.cpp Outdated Show resolved Hide resolved
src/common/types/int128_t.cpp Show resolved Hide resolved
src/common/types/int128_t.cpp Show resolved Hide resolved
src/common/types/int128_t.cpp Outdated Show resolved Hide resolved
@Ashleyhx Ashleyhx force-pushed the ashleyhx/add-hugeint branch 2 times, most recently from 3bf3bf9 to 3f5c929 Compare October 19, 2023 19:26
@Ashleyhx
Copy link
Contributor Author

@mewim could you take a look at the API part in kuzu.h and in capi/value.cpp?

Copy link
Collaborator

@acquamarin acquamarin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! One general comment is that we should increase the test coverage for edge cases.
I will let @mewim review the API.

CMakeLists.txt Outdated Show resolved Hide resolved
src/c_api/value.cpp Show resolved Hide resolved
src/common/types/int128_t.cpp Outdated Show resolved Hide resolved
src/common/types/int128_t.cpp Outdated Show resolved Hide resolved
src/common/types/int128_t.cpp Show resolved Hide resolved
src/common/types/int128_t.cpp Outdated Show resolved Hide resolved
src/common/types/int128_t.cpp Show resolved Hide resolved
src/common/types/int128_t.cpp Outdated Show resolved Hide resolved
src/common/types/int128_t.cpp Show resolved Hide resolved
test/test_files/tinysnb/function/comparison.test Outdated Show resolved Hide resolved
Copy link
Member

@mewim mewim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through the API related changes. The changes for Python and Node.js APIs LGTM.

For C API, the binding is not very user-friendly. The users will not understand val_.low, val_.high until they look into our internal implementation. I suggest to at least bind two more functions: kuzu_int128_t kuzu_int128_t_from_string(const char* str) and char* kuzu_int128_t_to_string(kuzu_int128_t val), so that the user can convert kuzu_int128_t from/to strings without understanding the internal implementation. Also, consider add a TODO item for binding the full set of int128_t functions of the C++ API.

For Java and Rust APIs, I see that only the type enums have been added, but no actual binding implementations. It is fine to implement these bindings as separate PRs, but an issue should be created for them so we don't miss them for the next release.

@mewim
Copy link
Member

mewim commented Oct 20, 2023

Also, we should change the title of this PR so it looks better in our release change log.

Copy link
Collaborator

@acquamarin acquamarin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My general comment is to improve test coverage as much as you can.

src/CMakeLists.txt Outdated Show resolved Hide resolved
src/common/types/int128_t.cpp Outdated Show resolved Hide resolved
src/common/types/int128_t.cpp Show resolved Hide resolved
src/common/types/int128_t.cpp Show resolved Hide resolved
src/common/types/int128_t.cpp Outdated Show resolved Hide resolved
src/include/common/int128_t.h Outdated Show resolved Hide resolved
src/include/function/aggregate/avg.h Outdated Show resolved Hide resolved
src/include/function/cast/cast_utils.h Outdated Show resolved Hide resolved
src/include/function/cast/cast_utils.h Outdated Show resolved Hide resolved
@Ashleyhx Ashleyhx force-pushed the ashleyhx/add-hugeint branch 3 times, most recently from 6c98bcc to e22143b Compare October 23, 2023 21:06
src/include/c_api/kuzu.h Outdated Show resolved Hide resolved
@Ashleyhx Ashleyhx changed the title Ashleyhx/add hugeint Add int128 and supported functions Oct 24, 2023
@Ashleyhx Ashleyhx merged commit 84018c4 into master Oct 24, 2023
12 checks passed
@Ashleyhx Ashleyhx deleted the ashleyhx/add-hugeint branch October 24, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants