morningman commented on code in PR #11046: URL: https://github.com/apache/doris/pull/11046#discussion_r926296324
########## be/src/exec/arrow/orc_reader.cpp: ########## @@ -52,6 +55,31 @@ Status ORCReaderWrap::init_reader(const TupleDescriptor* tuple_desc, return Status::EndOfFile("Empty Orc File"); } + int64_t row_number = 0; + int end_group = _total_groups; + for (int i = 0; i < _total_groups; i++) { + int64_t _offset = _reader->GetRawORCReader()->getStripe(i)->getOffset(); + int64_t row = _reader->GetRawORCReader()->getStripe(i)->getNumberOfRows(); + if (_offset < _range_start_offset) { + row_number += row; + } else if (_offset == _range_start_offset) { + _current_group = i; + } + if (_range_start_offset + _range_size <= _offset) { + end_group = i; + break; + } + } + LOG(INFO) << "This reader read orc file from offset: " << _range_start_offset + << " with size: " << _range_size << ". Also mean that read from strip id from " + << _current_group << " to " << end_group; + _total_groups = end_group; Review Comment: if `_total_groups` is 0 here, than we don't need to call `_reader->Seek()` ########## be/src/exec/arrow/orc_reader.cpp: ########## @@ -52,6 +55,31 @@ Status ORCReaderWrap::init_reader(const TupleDescriptor* tuple_desc, return Status::EndOfFile("Empty Orc File"); } + int64_t row_number = 0; + int end_group = _total_groups; + for (int i = 0; i < _total_groups; i++) { + int64_t _offset = _reader->GetRawORCReader()->getStripe(i)->getOffset(); + int64_t row = _reader->GetRawORCReader()->getStripe(i)->getNumberOfRows(); + if (_offset < _range_start_offset) { + row_number += row; + } else if (_offset == _range_start_offset) { + _current_group = i; Review Comment: `_current_group` may not be set here? And it may always be 0? -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org