davisusanibar commented on code in PR #35570:
URL: https://github.com/apache/arrow/pull/35570#discussion_r1307634778


##########
java/dataset/src/main/java/org/apache/arrow/dataset/scanner/ScanOptions.java:
##########
@@ -27,6 +28,7 @@
 public class ScanOptions {
   private final Optional<String[]> columns;
   private final long batchSize;
+  private ByteBuffer substraitExtendedExpression;

Review Comment:
   This is optional, is up to the user to configure this or not, it is part of 
the builder option



##########
java/dataset/src/main/cpp/jni_wrapper.cc:
##########
@@ -484,6 +493,56 @@ JNIEXPORT jlong JNICALL 
Java_org_apache_arrow_dataset_jni_JniWrapper_createScann
   JNI_METHOD_END(-1L)
 }
 
+/*
+ * Class:     org_apache_arrow_dataset_jni_JniWrapper
+ * Method:    createSubstraitScanner
+ * Signature: (JLjava/nio/ByteBuffer;JJ)J
+ */
+JNIEXPORT jlong JNICALL 
Java_org_apache_arrow_dataset_jni_JniWrapper_createSubstraitScanner(
+    JNIEnv* env, jobject, jlong dataset_id, jobject 
substrait_expr_produce_or_filter, jlong batch_size,
+    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 (substrait_expr_produce_or_filter != nullptr) {

Review Comment:
   changed



-- 
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]

Reply via email to