diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala index fa315e389f3b1..e5314d74ed8df 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala @@ -78,6 +78,8 @@ class Analyzer(catalog: Catalog, def failAnalysis(msg: String) = { throw new AnalysisException(msg) } def apply(plan: LogicalPlan): LogicalPlan = { + // We transform up and order the rules so as to catch the first possible failure instead + // of the result of cascading resolution failures. plan.foreachUp { case operator: LogicalPlan => operator transformAllExpressions {