zhztheplayer commented on code in PR #13561:
URL: https://github.com/apache/gluten/pull/13561#discussion_r4652305829
##########
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:
In general such check `rethrowJavaException` should be at the JNI boundery,
`WholeStageResultIterator.cc` is unaware of Java callsites.
--
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]