Detects output sort order to potentially remove `SortExec`. Only the `Int64` argument type is currently supported.
(&self, schema: &Schema)
| 340 | /// Detects output sort order to potentially remove `SortExec`. |
| 341 | /// Only the `Int64` argument type is currently supported. |
| 342 | fn output_ordering(&self, schema: &Schema) -> Option<PhysicalSortExpr> { |
| 343 | let step = match &self.args { |
| 344 | GenSeriesArgs::Int64Args { step, .. } => *step, |
| 345 | _ => return None, |
| 346 | }; |
| 347 | |
| 348 | if schema.fields().is_empty() { |
| 349 | return None; |
| 350 | } |
| 351 | |
| 352 | let descending = step < 0; |
| 353 | Some(PhysicalSortExpr::new( |
| 354 | Arc::new(Column::new(schema.field(0).name(), 0)), |
| 355 | SortOptions { |
| 356 | descending, |
| 357 | // this table function won't output nulls, so either is fine |
| 358 | nulls_first: false, |
| 359 | }, |
| 360 | )) |
| 361 | } |
| 362 | } |
| 363 | |
| 364 | #[derive(Debug, Clone)] |