HaoYang670 commented on code in PR #4391:
URL: https://github.com/apache/arrow-datafusion/pull/4391#discussion_r1034222322
##########
datafusion/core/src/physical_plan/limit.rs:
##########
@@ -365,30 +365,17 @@ impl ExecutionPlan for LocalLimitExec {
}
}
-/// Truncate a RecordBatch to maximum of n rows
-pub fn truncate_batch(batch: &RecordBatch, n: usize) -> RecordBatch {
- let limited_columns: Vec<ArrayRef> = (0..batch.num_columns())
- .map(|i| limit(batch.column(i), n))
- .collect();
-
- RecordBatch::try_new(batch.schema(), limited_columns).unwrap()
-}
-
/// A Limit stream skips `skip` rows, and then fetch up to `fetch` rows.
struct LimitStream {
- /// The number of rows to skip
+ /// The remaining number of rows to skip
skip: usize,
Review Comment:
Sure, I'll file a follow-up.
--
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]