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

Method limit

datafusion/expr/src/logical_plan/builder.rs:656–664  ·  view source on GitHub ↗

Limit the number of rows returned `skip` - Number of rows to skip before fetch any row. `fetch` - Maximum number of rows to fetch, after skipping `skip` rows, if specified.

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

Source from the content-addressed store, hash-verified

654 /// `fetch` - Maximum number of rows to fetch, after skipping `skip` rows,
655 /// if specified.
656 pub fn limit(self, skip: usize, fetch: Option<usize>) -> Result<Self> {
657 let skip_expr = if skip == 0 {
658 None
659 } else {
660 Some(lit(skip as i64))
661 };
662 let fetch_expr = fetch.map(|f| lit(f as i64));
663 self.limit_by_expr(skip_expr, fetch_expr)
664 }
665
666 /// Limit the number of rows returned
667 ///

Callers

nothing calls this directly

Calls 3

limit_by_exprMethod · 0.80
litFunction · 0.50
mapMethod · 0.45

Tested by

no test coverage detected