felipepessoto commented on code in PR #13561:
URL: https://github.com/apache/gluten/pull/13561#discussion_r4653758598
##########
cpp/velox/compute/WholeStageResultIterator.cc:
##########
@@ -305,23 +306,28 @@ std::shared_ptr<velox::core::QueryCtx>
WholeStageResultIterator::createNewVeloxQ
}
std::shared_ptr<ColumnarBatch> WholeStageResultIterator::next() {
- while (true) {
- if (!cursor_->moveNext()) {
- return nullptr;
- }
- RowVectorPtr vector = cursor_->current();
- GLUTEN_CHECK(vector != nullptr, "Cursor returned null vector.");
- uint64_t numRows = vector->size();
- if (numRows == 0) {
- continue;
- }
- {
- ScopedTimer timer(&loadLazyVectorTime_);
- for (auto& child : vector->children()) {
- child->loadedVector();
+ try {
+ while (true) {
+ if (!cursor_->moveNext()) {
+ return nullptr;
+ }
+ RowVectorPtr vector = cursor_->current();
+ GLUTEN_CHECK(vector != nullptr, "Cursor returned null vector.");
+ uint64_t numRows = vector->size();
+ if (numRows == 0) {
+ continue;
+ }
+ {
+ ScopedTimer timer(&loadLazyVectorTime_);
+ for (auto& child : vector->children()) {
+ child->loadedVector();
+ }
}
+ return std::make_shared<VeloxColumnarBatch>(vector);
}
- return std::make_shared<VeloxColumnarBatch>(vector);
+ } catch (const std::exception&) {
+ rethrowJavaException(std::current_exception());
Review Comment:
Agreed. In 41eb46bdc I removed the catch from
`WholeStageResultIterator::next()`. Only the `nativeHasNext` and `nativeNext`
JNI entry points now ask Velox to recover a Java throwable from a failed read;
core doesn’t depend on Velox exception types.
The lazy-output regression now checks the distinction directly: a C++ caller
sees the Velox exception, while both JNI reads restore the same Java throwable,
even when it’s reachable only through `VeloxException::wrappedException()`. A
native-only failure keeps its original exception for the existing fallback.
--
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]