Skip to content

Commit

Permalink
native writer support CreateHiveTableAsSelectCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
yikf committed Nov 7, 2024
1 parent c653337 commit 780e8f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,13 @@ class VeloxParquetWriteForHiveSuite extends GlutenQueryTest with SQLTestUtils {
checkAnswer(sql("SELECT * FROM t"), Row(1))
}
}

test("native writer support CreateHiveTableAsSelectCommand") {
withTable("t", "t2") {
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))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 780e8f4

Please sign in to comment.