MCPcopy Create free account
hub / github.com/apache/datafusion / limit

Method limit

datafusion/core/src/dataframe/mod.rs:724–733  ·  view source on GitHub ↗

Returns a new `DataFrame` with a limited number of rows. # Arguments `skip` - Number of rows to skip before fetch any row `fetch` - Maximum number of rows to return, after skipping `skip` rows. # Example ``` # use datafusion::prelude::*; # use datafusion::error::Result; # use datafusion_common::assert_batches_sorted_eq; # #[tokio::main] # async fn main() -> Result<()> { let ctx = SessionContext:

(self, skip: usize, fetch: Option<usize>)

Source from the content-addressed store, hash-verified

722 /// # }
723 /// ```
724 pub fn limit(self, skip: usize, fetch: Option<usize>) -> Result<DataFrame> {
725 let plan = LogicalPlanBuilder::from(self.plan)
726 .limit(skip, fetch)?
727 .build()?;
728 Ok(DataFrame {
729 session_state: self.session_state,
730 plan,
731 projection_requires_validation: self.projection_requires_validation,
732 })
733 }
734
735 /// Calculate the union of two [`DataFrame`]s, preserving duplicate rows.
736 ///

Callers 15

test_all_operatorsFunction · 0.45
test_with_csv_planFunction · 0.45
limit_pushdown_viewFunction · 0.45
test_csv_serializerFunction · 0.45
show_limitMethod · 0.45
scanMethod · 0.45
run_limit_testFunction · 0.45

Calls 1

buildMethod · 0.45

Tested by 15

test_all_operatorsFunction · 0.36
test_with_csv_planFunction · 0.36
limit_pushdown_viewFunction · 0.36
test_csv_serializerFunction · 0.36
run_limit_testFunction · 0.36
limitFunction · 0.36
explainFunction · 0.36