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>)
| 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. |