You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/12/02 06:18:56 UTC
[GitHub] [arrow] wgtmac commented on a diff in pull request #14806: ARROW-18421: [C++][ORC] Add accessor for number of rows by stripe in reader
wgtmac commented on code in PR #14806:
URL: https://github.com/apache/arrow/pull/14806#discussion_r1037818902
##########
cpp/src/arrow/adapters/orc/adapter.cc:
##########
@@ -217,6 +217,8 @@ class ORCFileReader::Impl {
int64_t NumberOfRows() { return static_cast<int64_t>(reader_->getNumberOfRows()); }
+ int64_t NumberOfRows(int64_t stripe) { return stripes_[stripe].num_rows; }
Review Comment:
Should we rename it to `NumberOfRowsInStripe` to avoid unintentional overloading?
##########
cpp/src/arrow/adapters/orc/adapter.cc:
##########
@@ -217,6 +217,8 @@ class ORCFileReader::Impl {
int64_t NumberOfRows() { return static_cast<int64_t>(reader_->getNumberOfRows()); }
+ int64_t NumberOfRows(int64_t stripe) { return stripes_[stripe].num_rows; }
Review Comment:
In addition, it is better to validate `stripe` and throw if out of range.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org