This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 9491b7d4224 [fix](iceberg) prevent coredump if read position delete 
file failed (#34802)
9491b7d4224 is described below

commit 9491b7d42240e73f0b148cf3ef75fda1abfec5d1
Author: Ashin Gau <ashin...@users.noreply.github.com>
AuthorDate: Tue May 14 14:03:33 2024 +0800

    [fix](iceberg) prevent coredump if read position delete file failed (#34802)
---
 be/src/vec/exec/format/table/iceberg_reader.cpp | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/be/src/vec/exec/format/table/iceberg_reader.cpp 
b/be/src/vec/exec/format/table/iceberg_reader.cpp
index 12ef77f59d0..f9de386e595 100644
--- a/be/src/vec/exec/format/table/iceberg_reader.cpp
+++ b/be/src/vec/exec/format/table/iceberg_reader.cpp
@@ -529,17 +529,15 @@ Status IcebergParquetReader::init_reader(
     _file_col_names = file_col_names;
     _colname_to_value_range = colname_to_value_range;
     auto parquet_meta_kv = parquet_reader->get_metadata_key_values();
-    static_cast<void>(_gen_col_name_maps(parquet_meta_kv));
+    RETURN_IF_ERROR(_gen_col_name_maps(parquet_meta_kv));
     _gen_file_col_names();
     _gen_new_colname_to_value_range();
     parquet_reader->set_table_to_file_col_map(_table_col_to_file_col);
     parquet_reader->iceberg_sanitize(_all_required_col_names);
-    Status status = parquet_reader->init_reader(
+    return parquet_reader->init_reader(
             _all_required_col_names, _not_in_file_col_names, 
&_new_colname_to_value_range,
             conjuncts, tuple_descriptor, row_descriptor, colname_to_slot_id,
             not_single_slot_filter_conjuncts, slot_id_to_filter_conjuncts);
-
-    return status;
 }
 
 Status IcebergParquetReader ::_read_position_delete_file(const TFileRangeDesc* 
delete_range,
@@ -556,7 +554,7 @@ Status IcebergParquetReader 
::_read_position_delete_file(const TFileRangeDesc* d
     std::unordered_map<std::string, std::tuple<std::string, const 
SlotDescriptor*>>
             partition_columns;
     std::unordered_map<std::string, VExprContextSPtr> missing_columns;
-    
static_cast<void>(parquet_delete_reader.set_fill_columns(partition_columns, 
missing_columns));
+    RETURN_IF_ERROR(parquet_delete_reader.set_fill_columns(partition_columns, 
missing_columns));
 
     const tparquet::FileMetaData* meta_data = 
parquet_delete_reader.get_meta_data();
     bool dictionary_coded = true;
@@ -608,11 +606,9 @@ Status IcebergOrcReader::init_reader(
     _gen_file_col_names();
     _gen_new_colname_to_value_range();
     orc_reader->set_table_col_to_file_col(_table_col_to_file_col);
-    Status status =
-            orc_reader->init_reader(&_all_required_col_names, 
&_new_colname_to_value_range,
-                                    conjuncts, false, tuple_descriptor, 
row_descriptor,
-                                    not_single_slot_filter_conjuncts, 
slot_id_to_filter_conjuncts);
-    return status;
+    return orc_reader->init_reader(&_all_required_col_names, 
&_new_colname_to_value_range,
+                                   conjuncts, false, tuple_descriptor, 
row_descriptor,
+                                   not_single_slot_filter_conjuncts, 
slot_id_to_filter_conjuncts);
 }
 
 Status IcebergOrcReader::_read_position_delete_file(const TFileRangeDesc* 
delete_range,
@@ -620,13 +616,13 @@ Status IcebergOrcReader::_read_position_delete_file(const 
TFileRangeDesc* delete
     OrcReader orc_delete_reader(_profile, _state, _params, *delete_range,
                                 READ_DELETE_FILE_BATCH_SIZE, 
_state->timezone(), _io_ctx);
     std::unordered_map<std::string, ColumnValueRangeType> 
colname_to_value_range;
-    Status init_status = orc_delete_reader.init_reader(
-            &delete_file_col_names, &colname_to_value_range, {}, false, {}, 
{}, nullptr, nullptr);
+    RETURN_IF_ERROR(orc_delete_reader.init_reader(&delete_file_col_names, 
&colname_to_value_range,
+                                                  {}, false, {}, {}, nullptr, 
nullptr));
 
     std::unordered_map<std::string, std::tuple<std::string, const 
SlotDescriptor*>>
             partition_columns;
     std::unordered_map<std::string, VExprContextSPtr> missing_columns;
-    static_cast<void>(orc_delete_reader.set_fill_columns(partition_columns, 
missing_columns));
+    RETURN_IF_ERROR(orc_delete_reader.set_fill_columns(partition_columns, 
missing_columns));
 
     bool eof = false;
     DataTypePtr data_type_file_path {new DataTypeString};


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to