LuciferYang commented on code in PR #13714:
URL: https://github.com/apache/gluten/pull/13714#discussion_r4705948381


##########
gluten-substrait/src/main/scala/org/apache/gluten/extension/columnar/PushDownInputFileExpression.scala:
##########
@@ -188,17 +221,36 @@ object PushDownInputFileExpression {
 
   object PostOffload extends Rule[SparkPlan] {
     override def apply(plan: SparkPlan): SparkPlan = plan.transformUp {
+      // A project over the scan that lists nothing but columns and input file 
function calls, such
+      // as the one PreOffload added: the scan, with a project over it for 
repeats, can produce its
+      // output.
       case p @ ProjectExec(projectList, child: FileSourceScanExecTransformer)
-          if projectList.exists(containsInputFileRelatedExpr) =>
-        child.copy(output = p.output)
+          if projectList.exists(containsInputFileRelatedExpr) && 
canCollapseProject(p) =>

Review Comment:
   Yes, that's enough. Changed in 4d21e2596: the file and Hive scan cases now 
match on an input file function call too, and `containsInputFileRelatedExpr` 
and `isInputFileAttrName` are removed, as nothing else used them. With project 
offload on, the plans don't change, since a user's column-only project is 
already a `ProjectExecTransformer` when PostOffload runs. With it off, such a 
project now stays on Spark over the scan instead of being folded into it. For 
`SELECT id, id` the plan is the same as before, because the fold put a Spark 
project back over the scan for the repeated column.
   



-- 
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]

Reply via email to