pitrou commented on code in PR #50369:
URL: https://github.com/apache/arrow/pull/50369#discussion_r3527477844


##########
cpp/src/arrow/table.cc:
##########
@@ -101,7 +101,7 @@ class SimpleTable : public Table {
 
   std::shared_ptr<Table> Slice(int64_t offset, int64_t length) const override {
     auto sliced = columns_;
-    int64_t num_rows = length;
+    int64_t num_rows = std::max<int64_t>(0, std::min(length, this->num_rows() 
- offset));
     for (auto& column : sliced) {
       column = column->Slice(offset, length);
       num_rows = column->length();

Review Comment:
   Why keep this line?



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

Reply via email to