sarutak commented on a change in pull request #32606:
URL: https://github.com/apache/spark/pull/32606#discussion_r636570921



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/RemoveRedundantProjects.scala
##########
@@ -97,6 +97,7 @@ object RemoveRedundantProjects extends Rule[SparkPlan] {
       // If a DataSourceV2ScanExec node does not support columnar, a 
ProjectExec node is required
       // to convert the rows to UnsafeRow. See DataSourceV2Strategy for more 
details.
       case d: DataSourceV2ScanExecBase if !d.supportsColumnar => false
+      case FilterExec(_, d: DataSourceV2ScanExecBase) if !d.supportsColumnar 
=> false

Review comment:
       The comment above covers this case right?

##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2Suite.scala
##########
@@ -435,6 +436,27 @@ class DataSourceV2Suite extends QueryTest with 
SharedSparkSession with AdaptiveS
       }
     }
   }
+
+  Seq("true", "false").foreach { codegenEnabled =>
+    test("SPARK-35287: project generating unsafe row " +
+      s"should not be removed (codegen=$codegenEnabled)") {

Review comment:
       Thanks I'll move this test to `RemoveRedundantProjectsSuite` but 
`codegenEnabled` outside the test definition is intentional. We can easily know 
which case (codegen enabled or disabled) fails.
   `DataFrameAggregateSuite` does the same way.
   
   
https://github.com/apache/spark/blob/master/sql/core/src/test/scala/org/apache/spark/sql/DataFrameAggregateSuite.scala#L1005-L1011




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

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