This is an automated email from the ASF dual-hosted git repository.

jackylee pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new cfb55ef933 native writer support CreateHiveTableAsSelectCommand (#7851)
cfb55ef933 is described below

commit cfb55ef933d2209edb443dada88c267691f0eb38
Author: Kaifei Yi <[email protected]>
AuthorDate: Fri Nov 8 14:05:26 2024 +0800

    native writer support CreateHiveTableAsSelectCommand (#7851)
---
 .../spark/sql/execution/VeloxParquetWriteForHiveSuite.scala      | 9 +++++++++
 .../sql/execution/datasources/GlutenWriterColumnarRules.scala    | 6 ++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git 
a/backends-velox/src/test/scala/org/apache/spark/sql/execution/VeloxParquetWriteForHiveSuite.scala
 
b/backends-velox/src/test/scala/org/apache/spark/sql/execution/VeloxParquetWriteForHiveSuite.scala
index 412548de9c..8c2b98988e 100644
--- 
a/backends-velox/src/test/scala/org/apache/spark/sql/execution/VeloxParquetWriteForHiveSuite.scala
+++ 
b/backends-velox/src/test/scala/org/apache/spark/sql/execution/VeloxParquetWriteForHiveSuite.scala
@@ -176,4 +176,13 @@ class VeloxParquetWriteForHiveSuite extends 
GlutenQueryTest with SQLTestUtils {
       checkAnswer(sql("SELECT * FROM t"), Row(1))
     }
   }
+
+  test("native writer support CreateHiveTableAsSelectCommand") {
+    withTable("t") {
+      withSQLConf("spark.sql.hive.convertMetastoreParquet" -> "false") {
+        checkNativeWrite("CREATE TABLE t STORED AS PARQUET AS SELECT 1 as c", 
checkNative = true)
+      }
+      checkAnswer(spark.table("t"), Row(1))
+    }
+  }
 }
diff --git 
a/gluten-substrait/src/main/scala/org/apache/spark/sql/execution/datasources/GlutenWriterColumnarRules.scala
 
b/gluten-substrait/src/main/scala/org/apache/spark/sql/execution/datasources/GlutenWriterColumnarRules.scala
index d33e779eb3..917f6c03df 100644
--- 
a/gluten-substrait/src/main/scala/org/apache/spark/sql/execution/datasources/GlutenWriterColumnarRules.scala
+++ 
b/gluten-substrait/src/main/scala/org/apache/spark/sql/execution/datasources/GlutenWriterColumnarRules.scala
@@ -121,8 +121,10 @@ object GlutenWriterColumnarRules {
         command.table.storage.outputFormat
           .flatMap(formatMapping.get)
           .filter(GlutenFormatFactory.isRegistered)
-      case _: CreateHiveTableAsSelectCommand =>
-        None
+      case command: CreateHiveTableAsSelectCommand =>
+        command.tableDesc.storage.outputFormat
+          .flatMap(formatMapping.get)
+          .filter(GlutenFormatFactory.isRegistered)
       case _ =>
         None
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to