Get a reference to the logical plan's schema
(&self)
| 323 | impl LogicalPlan { |
| 324 | /// Get a reference to the logical plan's schema |
| 325 | pub fn schema(&self) -> &DFSchemaRef { |
| 326 | match self { |
| 327 | LogicalPlan::EmptyRelation(EmptyRelation { schema, .. }) => schema, |
| 328 | LogicalPlan::Values(Values { schema, .. }) => schema, |
| 329 | LogicalPlan::TableScan(TableScan { |
| 330 | projected_schema, .. |
| 331 | }) => projected_schema, |
| 332 | LogicalPlan::Projection(Projection { schema, .. }) => schema, |
| 333 | LogicalPlan::Filter(Filter { input, .. }) => input.schema(), |
| 334 | LogicalPlan::Distinct(Distinct::All(input)) => input.schema(), |
| 335 | LogicalPlan::Distinct(Distinct::On(DistinctOn { schema, .. })) => schema, |
| 336 | LogicalPlan::Window(Window { schema, .. }) => schema, |
| 337 | LogicalPlan::Aggregate(Aggregate { schema, .. }) => schema, |
| 338 | LogicalPlan::Sort(Sort { input, .. }) => input.schema(), |
| 339 | LogicalPlan::Join(Join { schema, .. }) => schema, |
| 340 | LogicalPlan::Repartition(Repartition { input, .. }) => input.schema(), |
| 341 | LogicalPlan::Limit(Limit { input, .. }) => input.schema(), |
| 342 | LogicalPlan::Statement(statement) => statement.schema(), |
| 343 | LogicalPlan::Subquery(Subquery { subquery, .. }) => subquery.schema(), |
| 344 | LogicalPlan::SubqueryAlias(SubqueryAlias { schema, .. }) => schema, |
| 345 | LogicalPlan::Explain(explain) => &explain.schema, |
| 346 | LogicalPlan::Analyze(analyze) => &analyze.schema, |
| 347 | LogicalPlan::Extension(extension) => extension.node.schema(), |
| 348 | LogicalPlan::Union(Union { schema, .. }) => schema, |
| 349 | LogicalPlan::DescribeTable(DescribeTable { output_schema, .. }) => { |
| 350 | output_schema |
| 351 | } |
| 352 | LogicalPlan::Dml(DmlStatement { output_schema, .. }) => output_schema, |
| 353 | LogicalPlan::Copy(CopyTo { output_schema, .. }) => output_schema, |
| 354 | LogicalPlan::Ddl(ddl) => ddl.schema(), |
| 355 | LogicalPlan::Unnest(Unnest { schema, .. }) => schema, |
| 356 | LogicalPlan::RecursiveQuery(RecursiveQuery { static_term, .. }) => { |
| 357 | // we take the schema of the static term as the schema of the entire recursive query |
| 358 | static_term.schema() |
| 359 | } |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | /// Used for normalizing columns, as the fallback schemas to the main schema |
| 364 | /// of the plan. |
no outgoing calls