vibhatha commented on code in PR #36967:
URL: https://github.com/apache/arrow/pull/36967#discussion_r1424861363
##########
java/dataset/src/main/cpp/jni_wrapper.cc:
##########
@@ -528,6 +528,43 @@ JNIEXPORT jlong JNICALL
Java_org_apache_arrow_dataset_jni_JniWrapper_createScann
JNI_METHOD_END(-1L)
}
+/*
+ * Class: org_apache_arrow_dataset_jni_JniWrapper
+ * Method: createRangeScanner
+ * Signature: (J[Ljava/lang/String;Ljava/lang/String;JJJJ)J
+ */
+JNIEXPORT jlong JNICALL
Java_org_apache_arrow_dataset_jni_JniWrapper_createRangeScanner(
+ JNIEnv* env, jobject, jlong dataset_id, jobjectArray columns, jstring
filter,
+ jlong batch_size, jlong start_offset, jlong length, jlong memory_pool_id) {
+ JNI_METHOD_START
+ arrow::MemoryPool* pool =
reinterpret_cast<arrow::MemoryPool*>(memory_pool_id);
+ if (pool == nullptr) {
+ JniThrow("Memory pool does not exist or has been closed");
+ }
+ std::shared_ptr<arrow::dataset::Dataset> dataset =
+ RetrieveNativeInstance<arrow::dataset::Dataset>(dataset_id);
+ 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);
+ JniAssertOkOrThrow(scanner_builder->Project(column_vector));
+ }
+ if (filter != nullptr) {
+ // TODO: PR 32625 OR PR 14287.
Review Comment:
could we add Github issue links?
--
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]