Skip to content

Commit

Permalink
Fix JNI build broken by to_arrow signature change (#6595)
Browse files Browse the repository at this point in the history
#6430 added struct_type support to to_arrow()/from_arrow().
The change in signature broke cudf/jni code.
This commit fixes that break.
  • Loading branch information
mythrocks authored Oct 26, 2020
1 parent e598a29 commit 7e8eb45
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
- PR #6543 Handle `np.nan` values in `isna`/`isnull`/`notna`/`notnull`
- PR #6549 Fix memory_usage calls for list columns
- PR #6575 Fix JNI RMM initialize with no pool allocator limit
- PR #6595 Fix JNI build, broken by to_arrow() signature change


# cuDF 0.16.0 (21 Oct 2020)
Expand Down
10 changes: 9 additions & 1 deletion java/src/main/native/src/TableJni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,15 @@ JNIEXPORT jlong JNICALL Java_ai_rapids_cudf_Table_convertCudfToArrowTable(JNIEnv
try {
cudf::jni::auto_set_device(env);
std::unique_ptr<std::shared_ptr<arrow::Table>> result(new std::shared_ptr<arrow::Table>(nullptr));
*result = cudf::to_arrow(*tview, state->column_names);
auto column_metadata = std::vector<cudf::column_metadata>{};
column_metadata.reserve(state->column_names.size());
std::transform(
std::begin(state->column_names),
std::end(state->column_names),
std::back_inserter(column_metadata),
[](auto const& column_name) { return cudf::column_metadata{column_name}; }
);
*result = cudf::to_arrow(*tview, column_metadata);
if (!result->get()) {
return 0;
}
Expand Down

0 comments on commit 7e8eb45

Please sign in to comment.