davisusanibar commented on code in PR #35570:
URL: https://github.com/apache/arrow/pull/35570#discussion_r1304703302
##########
java/dataset/src/main/cpp/jni_wrapper.cc:
##########
@@ -470,12 +471,37 @@ JNIEXPORT jlong JNICALL
Java_org_apache_arrow_dataset_jni_JniWrapper_createScann
std::shared_ptr<arrow::dataset::ScannerBuilder> scanner_builder =
JniGetOrThrow(dataset->NewScan());
JniAssertOkOrThrow(scanner_builder->Pool(pool));
- if (columns != nullptr) {
- std::vector<std::string> column_vector = ToStringVector(env, columns);
+ if (columns_subset != nullptr) {
+ std::vector<std::string> column_vector = ToStringVector(env,
columns_subset);
JniAssertOkOrThrow(scanner_builder->Project(column_vector));
}
+ if (columns_to_produce_or_filter != nullptr) {
+ auto *buff =
reinterpret_cast<jbyte*>(env->GetDirectBufferAddress(columns_to_produce_or_filter));
Review Comment:
changed
##########
java/dataset/src/main/cpp/jni_wrapper.cc:
##########
@@ -470,12 +471,37 @@ JNIEXPORT jlong JNICALL
Java_org_apache_arrow_dataset_jni_JniWrapper_createScann
std::shared_ptr<arrow::dataset::ScannerBuilder> scanner_builder =
JniGetOrThrow(dataset->NewScan());
JniAssertOkOrThrow(scanner_builder->Pool(pool));
- if (columns != nullptr) {
- std::vector<std::string> column_vector = ToStringVector(env, columns);
+ if (columns_subset != nullptr) {
+ std::vector<std::string> column_vector = ToStringVector(env,
columns_subset);
JniAssertOkOrThrow(scanner_builder->Project(column_vector));
}
+ if (columns_to_produce_or_filter != nullptr) {
+ auto *buff =
reinterpret_cast<jbyte*>(env->GetDirectBufferAddress(columns_to_produce_or_filter));
+ int length = env->GetDirectBufferCapacity(columns_to_produce_or_filter);
+ std::shared_ptr<arrow::Buffer> buffer =
JniGetOrThrow(arrow::AllocateBuffer(length));
+ std::memcpy(buffer->mutable_data(), buff, length);
Review Comment:
added
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]