-
Notifications
You must be signed in to change notification settings - Fork 94
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 functions exposing conversion to Arrow ArrayData #1827
Conversation
c21e3fb
to
1bda975
Compare
1bda975
to
ca40a48
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1827 +/- ##
==========================================
- Coverage 91.30% 91.28% -0.02%
==========================================
Files 799 794 -5
Lines 28996 28828 -168
==========================================
- Hits 26475 26316 -159
+ Misses 2521 2512 -9
☔ View full report in Codecov by Sentry. |
a2d3e8f
to
b004523
Compare
// Could use directly, except that we can't (yet) mark ArrowSchema as being safe to store in a | ||
// cxx::UniquePtr | ||
return *result.getArrowSchema(); | ||
} |
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.
Add an empty line between these two functions.
src/include/c_api/kuzu.h
Outdated
* | ||
* It is the caller's responsibility to call the release function to release the underlying data | ||
*/ | ||
struct ArrowArray kuzu_query_result_to_arrow_array(kuzu_query_result* query_result); |
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.
hmm should this be kuzu_query_result_get_next_arrow_chunk
?
4c51235
to
5d9650b
Compare
76220d9
to
6f8e8ea
Compare
6f8e8ea
to
2e5682f
Compare
Fixes #1804
I've added functions to the C and C++ API which allow conversion of query result data to the structures defined in the Arrow C Data Interface.
The rust API takes this a step further and, similarly to the python API, converts it to the
arrow::array::ArrayData
type (which seems a little difficult to use by itself, but converting it to more ergonomic types requires a lot of copying and probably has poor performance, so I thought it best to leave it as ArrayData and let the user decide if they want to use it directly or convert it).The arrow conversion is hidden behind an
arrow
feature to avoid pulling in the large arrow crate by default.Rust test will probably fail with the arrow feature. Testing locally the latest version of one of the arrow-rs dependencies requires rust 1.70, which is very recent; I had to manually force it to use an earlier version to get it to build on rust 1.69.