viirya commented on a change in pull request #33583:
URL: https://github.com/apache/spark/pull/33583#discussion_r684726566
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/SchemaPruning.scala
##########
@@ -143,15 +145,15 @@ object SchemaPruning extends Rule[LogicalPlan] {
// Construct the new projections of our Project by
// rewriting the original projections
- val newProjects = projects.map(_.transformDown {
+ val newProjects = normalizedProjects.map(_.transformDown {
case projectionOverSchema(expr) => expr
}).map { case expr: NamedExpression => expr }
if (log.isDebugEnabled) {
logDebug(s"New
projects:\n${newProjects.map(_.treeString).mkString("\n")}")
}
- Project(newProjects, projectionChild)
+ Project(restoreOriginalOutputNames(newProjects, projects.map(_.name)),
projectionChild)
Review comment:
Seems okay.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]