I've read this question in which the OP tried to convert this logical plan:
Aggregate [sum(inc(vals#4L)) AS sum(inc(vals))#7L]
+- LocalRelation [vals#4L]
To this:
Aggregate [sum(inc_val#6L) AS sum(inc(vals))#7L]
+- Project [inc(vals#4L) AS inc_val#6L]
+- LocalRelation [vals#4L]
I have a couple of questions:
- Why did he want to have the Project operator? What is the advantage of it?
- As far as I know, Project is the operator that represents the SELECT statement, so how could possibly a plan not include a Project operator?