From f959f720b4755b870b942649fed77178b7447227 Mon Sep 17 00:00:00 2001 From: jackylee-ch Date: Mon, 24 Oct 2022 10:00:02 +0800 Subject: [PATCH] Replace ValueOrDie with status check to avoid executor die --- native-sql-engine/cpp/src/codegen/common/relation_column.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/native-sql-engine/cpp/src/codegen/common/relation_column.h b/native-sql-engine/cpp/src/codegen/common/relation_column.h index a1599bbe5..9d3deb477 100644 --- a/native-sql-engine/cpp/src/codegen/common/relation_column.h +++ b/native-sql-engine/cpp/src/codegen/common/relation_column.h @@ -54,7 +54,11 @@ class LazyBatchIterator { bool AdvanceTo(int32_t batch_id) { for (; current_batch_id_ <= batch_id; current_batch_id_++) { - std::shared_ptr next = in_.Next().ValueOrDie(); + auto result = in_.Next(); + if (!result.ok()) { + throw JniPendingException("Get next batch failed."); + } + std::shared_ptr next = result.ValueUnsafe(); if (next == nullptr) { return false; }