Skip to content

Commit

Permalink
Remove unnecessary Project.
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Aug 31, 2020
1 parent 95e8fd4 commit 5db1e0f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ object ResolveUnion extends Rule[LogicalPlan] {
val leftChild = if (allowMissingCol) {
// Add missing (nested) fields to left plan.
val (leftProjectList, _) = compareAndAddFields(rightChild, left, allowMissingCol)
Project(leftProjectList, left)
if (leftProjectList.map(_.toAttribute) != left.output) {
Project(leftProjectList, left)
} else {
left
}
} else {
left
}
Expand Down

0 comments on commit 5db1e0f

Please sign in to comment.