felipepessoto commented on code in PR #13561:
URL: https://github.com/apache/gluten/pull/13561#discussion_r4648722080


##########
cpp/velox/operators/plannodes/RowVectorStream.cc:
##########
@@ -70,7 +71,7 @@ bool RowVectorStream::hasNext() {
         "ExternalStreamDataSource::next() is not called "
         "from a driver thread");
     SuspendedSection ss(driverThreadCtx->driverCtx()->driver);
-    hasNext = iterator_->hasNext();
+    hasNext = wrapJavaException([&]() { return iterator_->hasNext(); });

Review Comment:
   Yes, the JNI iterator can do this. In dfe805a40 I moved `wrapJavaException` 
into `VeloxJniColumnarBatchIterator::next()` and removed it from both 
`RowVectorStream` and `CudfVectorStream`.
   
   I also found that `addIteratorSplits`, which Delta uses for stats tracking, 
constructed the base JNI iterator directly. It now uses the same backend 
factory as the initial inputs. With the old constructor, the new late-split 
tests got a generic `GlutenException` for failures from both Java `hasNext` and 
`next`. With the factory, they get the original Spark throwable back. The JNI 
and Delta stats/constraint suites passed on Spark 3.5 and 4.1. I shortened the 
PR description too.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to