From 3251c8752d9d12c30d48b5991005cae044991252 Mon Sep 17 00:00:00 2001 From: yanz Date: Mon, 18 Jul 2022 21:01:37 +0800 Subject: [PATCH] fix ut --- be/src/exec/vectorized/hdfs_scanner.cpp | 12 ------------ be/test/exec/vectorized/hdfs_scanner_test.cpp | 1 + 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/be/src/exec/vectorized/hdfs_scanner.cpp b/be/src/exec/vectorized/hdfs_scanner.cpp index 832a809ce5a9f..c4eada33752b6 100644 --- a/be/src/exec/vectorized/hdfs_scanner.cpp +++ b/be/src/exec/vectorized/hdfs_scanner.cpp @@ -70,18 +70,6 @@ Status HdfsScanner::init(RuntimeState* runtime_state, const HdfsScannerParams& s RETURN_IF_ERROR( Expr::clone_if_not_exists(_scanner_params.min_max_conjunct_ctxs, runtime_state, &_min_max_conjunct_ctxs)); - // Why we need this class? Because in above code, we clone many conjuncts from runtime_state->obj_pool() - // And if we quit execution by early abortion, ~RuntimeState() is called directly - // And those conjuncts are released befoe `HdfsScanner` class, so when we call `HdfsScanner::close` - // we will get invalid pointers. And to resolve this problem, we add this instance at the end of obj_pool. - // so this instance must be released before conjuncts, and `HdfsScanner::close` will get valid pointers. - struct ReleaseFence { - HdfsScanner* ptr; - ReleaseFence(HdfsScanner* p) : ptr(p) {} - ~ReleaseFence() { ptr->finalize(); } - }; - _runtime_state->obj_pool()->add(new ReleaseFence(this)); - Status status = do_init(runtime_state, scanner_params); return status; } diff --git a/be/test/exec/vectorized/hdfs_scanner_test.cpp b/be/test/exec/vectorized/hdfs_scanner_test.cpp index a7eabb18f5389..2d2a4b18efb3d 100644 --- a/be/test/exec/vectorized/hdfs_scanner_test.cpp +++ b/be/test/exec/vectorized/hdfs_scanner_test.cpp @@ -1143,6 +1143,7 @@ TEST_F(HdfsScannerTest, TestParqueTypeMismatchDecodeMinMax) { } status = scanner->open(_runtime_state); EXPECT_TRUE(!status.ok()); + scanner->close(_runtime_state); } } // namespace starrocks::vectorized