sollhui commented on code in PR #67273:
URL: https://github.com/apache/doris/pull/67273#discussion_r4332739105


##########
be/src/format/parquet/vparquet_reader.cpp:
##########
@@ -343,6 +343,12 @@ Status ParquetReader::_open_file() {
                                        : _file_reader;
     }
 
+    // A range size of -1 means reading from the range start to the end of the 
file. Resolve it
+    // after opening the file so row-group filtering can use the actual range 
boundary.
+    if (_range_size == -1) {

Review Comment:
   [P2] Initialize the range members in the schema-only constructors before 
reading them here
   
   Both `ParquetReader(params, range, ...)` constructors (the raw-pointer and 
shared-pointer `IOContext` overloads) leave `_range_size` and 
`_range_start_offset` uninitialized, and neither member has a default 
initializer in the header. The Parquet TVF schema-inference path reaches this 
code through `fetch_table_schema` -> `ParquetReader::create_unique(params, 
range, io_ctx, nullptr)` -> `init_schema_reader()` -> `_open_file()`. This new 
condition therefore reads an uninitialized `_range_size` on that path, 
introducing undefined behavior; if the branch is taken, the subtraction also 
reads an uninitialized `_range_start_offset`.
   
   Please initialize both members from `range.size` and `range.start_offset` in 
those two constructors, as the normal scan constructors already do, and add 
coverage for the schema-only path. The two new Stream Load regressions use the 
normal scan constructors and do not exercise this case.



-- 
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]

Reply via email to