Github user hvanhovell commented on a diff in the pull request: https://github.com/apache/spark/pull/16233#discussion_r94688615 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala --- @@ -2224,6 +2348,18 @@ object EliminateSubqueryAliases extends Rule[LogicalPlan] { } /** + * Removes [[View]] operators from the plan. The operator is respected till the end of analysis + * stage because we want to see which part of a analyzed logical plan is generated from a view. + */ +object EliminateView extends Rule[LogicalPlan] { + def apply(plan: LogicalPlan): LogicalPlan = plan transformUp { + // If the child of a view is empty, we will throw an AnalysisException later in + // `checkAnalysis`. + case View(_, output, Some(child)) => Project(output, child) --- End diff -- I am not sure the project is needed at all (the child should output the attributes anyway). Also make sure we check if the child outputs the required attributes (for example in checkanalysis).
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org