jackylee-ch commented on code in PR #8422:
URL: https://github.com/apache/incubator-gluten/pull/8422#discussion_r1906649398


##########
backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxRuleApi.scala:
##########
@@ -103,6 +104,7 @@ object VeloxRuleApi {
       .getExtendedColumnarPostRules()
       .foreach(each => injector.injectPost(c => each(c.session)))
     injector.injectPost(c => ColumnarCollapseTransformStages(c.glutenConf))
+    injector.injectPost(c => GlutenNoopWriterRule(c.session))

Review Comment:
   > Could you please explain why the ColumnarToRow transformation was added, 
perhaps with a simple example? 
   
   Sure. Currently the `NoopWrite` doesn't support Columnar, then if the child 
plan is a ColumnarNode, it would add a ColumnarToRow. Here is a little example 
in `GlutenNoopWriterRuleSuite`.
   ```
   
spark.read.parquet(dir.getPath).write.format("noop").mode(SaveMode.Overwrite).save()
   ```
   Before this pr.
   ```
   OverwriteByExpression 
org.apache.spark.sql.execution.datasources.v2.DataSourceV2Strategy$$Lambda$2963/640995328@70bc9070,
 org.apache.spark.sql.execution.datasources.noop.NoopWrite$@5d202dc4
   +- VeloxColumnarToRow
      +- ^(1) FileScanTransformer parquet [id#3L] Batched: true, DataFilters: 
[], Format: Parquet, Location: InMemoryFileIndex(1 
paths)[file:/private/var/folders/bb/4fvsn8r949d3kghh68lx3sqr0000gp/T/spark-f7...,
 PartitionFilters: [], PushedFilters: [], ReadSchema: struct<id:bigint> 
NativeFilters: []
   ```
   After this pr.
   ```
   OverwriteByExpression 
org.apache.spark.sql.execution.datasources.v2.DataSourceV2Strategy$$Lambda$2933/1354033074@14c18a6a,
 org.apache.spark.sql.execution.datasources.noop.NoopWrite$@6aa792
   +- FakeRowAdaptor
      +- ^(2) FileScanTransformer parquet [id#3L] Batched: true, DataFilters: 
[], Format: Parquet, Location: InMemoryFileIndex(1 
paths)[file:/private/var/folders/bb/4fvsn8r949d3kghh68lx3sqr0000gp/T/spark-34...,
 PartitionFilters: [], PushedFilters: [], ReadSchema: struct<id:bigint> 
NativeFilters: []
   ```



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