Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/18079#discussion_r118833830 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala --- @@ -592,7 +592,23 @@ class Analyzer( def resolveRelation(plan: LogicalPlan): LogicalPlan = plan match { case u: UnresolvedRelation if !isRunningDirectlyOnFiles(u.tableIdentifier) => val defaultDatabase = AnalysisContext.get.defaultDatabase - val relation = lookupTableFromCatalog(u, defaultDatabase) + val foundRelation = lookupTableFromCatalog(u, defaultDatabase) + + // If alias names assigned, add `Project` with the aliases + val relation = if (u.outputNames.nonEmpty) { + val outputAttrs = foundRelation.output + // Checks if the number of the aliases is equal to expected one --- End diff -- > // Checks if the number of the aliases equals to the number of columns in the table.
--- 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