You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/07/21 06:28:58 UTC

[GitHub] [doris] morningman commented on a diff in pull request #11046: [feature-wip][multi-catalog] Support orc format file split for file scan node

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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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