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

suxiaogang223 pushed a commit to branch refact_reader_branch
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/refact_reader_branch by this 
push:
     new 472c1cca43c [fix](be) Fix parquet batch row cast
472c1cca43c is described below

commit 472c1cca43c0336a353d999f98ba55d8ada4f9bd
Author: Socrates <[email protected]>
AuthorDate: Wed May 27 17:41:20 2026 +0800

    [fix](be) Fix parquet batch row cast
    
    ### What problem does this PR solve?
    
    Issue Number: close #xxx
    
    Related PR: #xxx
    
    Problem Summary: Fix a DEBUG build failure in the new parquet reader by 
asserting the read batch size before converting it to the selection vector row 
count type.
    
    ### Release note
    
    None
    
    ### Check List (For Author)
    
    - Test: Manual test
        - Ran clang-format dry-run and git diff --check for the modified 
parquet reader file. Fedora DEBUG BE build was run and exposed the fixed 
compile failure; full build will be rerun after syncing this commit.
    - Behavior changed: No
    - Does this need documentation: No
---
 be/src/format/new_parquet/parquet_reader.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/be/src/format/new_parquet/parquet_reader.cpp 
b/be/src/format/new_parquet/parquet_reader.cpp
index 677a596debf..190aa87f251 100644
--- a/be/src/format/new_parquet/parquet_reader.cpp
+++ b/be/src/format/new_parquet/parquet_reader.cpp
@@ -23,6 +23,7 @@
 #include <parquet/api/reader.h>
 
 #include <algorithm>
+#include <limits>
 #include <map>
 #include <memory>
 #include <string_view>
@@ -428,7 +429,8 @@ Status ParquetReader::_read_current_row_group_batch(int64_t 
batch_rows, Block* f
         return Status::OK();
     }
     SelectionVector selection;
-    uint16_t selected_rows = batch_rows;
+    DORIS_CHECK(batch_rows <= std::numeric_limits<uint16_t>::max());
+    uint16_t selected_rows = static_cast<uint16_t>(batch_rows);
     // 1. Read all predicate columns and evaluate selection vector.
     RETURN_IF_ERROR(_read_filter_columns(batch_rows, file_block, &selection, 
&selected_rows));
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to