PHILO-HE commented on code in PR #8422:
URL: https://github.com/apache/incubator-gluten/pull/8422#discussion_r1904871521


##########
shims/common/src/main/scala/org/apache/gluten/config/GlutenConfig.scala:
##########
@@ -1776,6 +1778,13 @@ object GlutenConfig {
       .booleanConf
       .createOptional
 
+  val NOOP_WRITER_ENABLED =
+    buildConf("spark.gluten.sql.noop.writer.enabled")

Review Comment:
   Nit:
   `xxx.noopWriter.enabled`



##########
gluten-substrait/src/main/scala/org/apache/spark/sql/execution/datasources/GlutenWriterColumnarRules.scala:
##########
@@ -133,19 +132,33 @@ object GlutenWriterColumnarRules {
     }
   }
 
-  case class NativeWritePostRule(session: SparkSession) extends 
Rule[SparkPlan] {
+  private[datasources] def injectFakeRowAdaptor(command: SparkPlan, child: 
SparkPlan): SparkPlan = {
+    child match {
+      // if the child is columnar, we can just wrap&transfer the columnar data

Review Comment:
   Nit:
   wrap & transfer.



##########
gluten-substrait/src/main/scala/org/apache/spark/sql/execution/datasources/noop/GlutenNoopWriterRule.scala:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.spark.sql.execution.datasources.noop
+
+import org.apache.gluten.config.GlutenConfig
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.rules.Rule
+import org.apache.spark.sql.execution.SparkPlan
+import 
org.apache.spark.sql.execution.datasources.GlutenWriterColumnarRules.injectFakeRowAdaptor
+import org.apache.spark.sql.execution.datasources.v2.{AppendDataExec, 
OverwriteByExpressionExec}
+
+case class GlutenNoopWriterRule(session: SparkSession) extends Rule[SparkPlan] 
{
+  override def apply(p: SparkPlan): SparkPlan = p match {
+    case rc @ AppendDataExec(_, _, NoopWrite) if 
GlutenConfig.get.enableNoopWriter =>

Review Comment:
   I note the below check is removed. Could you clarify this change?
   `write.getClass.getName == NOOP_WRITE && 
BackendsApiManager.getSettings.enableNativeWriteFiles()`



##########
shims/common/src/main/scala/org/apache/gluten/config/GlutenConfig.scala:
##########
@@ -1776,6 +1778,13 @@ object GlutenConfig {
       .booleanConf
       .createOptional
 
+  val NOOP_WRITER_ENABLED =
+    buildConf("spark.gluten.sql.noop.writer.enabled")

Review Comment:
   Curious why we need this config? Can we just use it for suitable case? If 
some Spark UT checks failed, we may modify it to adapt to Gluten's plan.



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