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

Method sort

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

Sort the DataFrame by the specified sorting expressions. Note that any expression can be turned into a sort expression by calling its [sort](Expr::sort) method. # Example ``` # use datafusion::prelude::*; # use datafusion::error::Result; # use datafusion_common::assert_batches_sorted_eq; # #[tokio::main] # async fn main() -> Result<()> { let ctx = SessionContext::new(); let df = ctx .read_csv("

(self, expr: Vec<SortExpr>)

Source from the content-addressed store, hash-verified

1222 /// # }
1223 /// ```
1224 pub fn sort(self, expr: Vec<SortExpr>) -> Result<DataFrame> {
1225 let plan = LogicalPlanBuilder::from(self.plan).sort(expr)?.build()?;
1226 Ok(DataFrame {
1227 session_state: self.session_state,
1228 plan,
1229 projection_requires_validation: self.projection_requires_validation,
1230 })
1231 }
1232
1233 /// Join this `DataFrame` with another `DataFrame` using explicitly specified
1234 /// columns and an optional filter expression.

Callers 15

test_all_operatorsFunction · 0.45
sort_byMethod · 0.45
write_tableMethod · 0.45
write_csvMethod · 0.45
write_jsonMethod · 0.45
write_parquetMethod · 0.45
sort_batchesFunction · 0.45
run_limit_testFunction · 0.45
make_staggered_batchesFunction · 0.45
make_staggered_batchesFunction · 0.45
group_by_string_testFunction · 0.45
make_staggered_batchesFunction · 0.45

Calls 1

buildMethod · 0.45

Tested by 15

test_all_operatorsFunction · 0.36
sort_batchesFunction · 0.36
run_limit_testFunction · 0.36
make_staggered_batchesFunction · 0.36
make_staggered_batchesFunction · 0.36
group_by_string_testFunction · 0.36
make_staggered_batchesFunction · 0.36
generateMethod · 0.36
test_distinct_sort_byFunction · 0.36
test_distinct_on_sort_byFunction · 0.36