@@ -110,6 +110,20 @@ index 4410fe50912..43bcce2a038 100644
110110 case _ => Map[String, String]()
111111 }
112112 val childrenInfo = children.flatMap {
113+ diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/charvarchar.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/charvarchar.sql.out
114+ index 524797015a2..09576b169bd 100644
115+ --- a/sql/core/src/test/resources/sql-tests/analyzer-results/charvarchar.sql.out
116+ +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/charvarchar.sql.out
117+ @@ -738,3 +738,9 @@ SELECT to_varchar(12454.8, '99,999.9S')
118+ -- !query analysis
119+ Project [to_char(12454.8, 99,999.9S) AS to_char(12454.8, 99,999.9S)#x]
120+ +- OneRowRelation
121+ +
122+ +
123+ + -- !query
124+ + SET spark.comet.parquet.write.enabled = true
125+ + -- !query analysis
126+ + SetCommand (spark.comet.parquet.write.enabled,Some(true))
113127diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/listagg-collations.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/listagg-collations.sql.out
114128index 7aca17dcb25..8afeb3b4a2f 100644
115129--- a/sql/core/src/test/resources/sql-tests/analyzer-results/listagg-collations.sql.out
@@ -130,6 +144,23 @@ index 7aca17dcb25..8afeb3b4a2f 100644
130144 -- !query
131145 WITH t(c1) AS (SELECT replace(listagg(DISTINCT col1 COLLATE unicode_rtrim) COLLATE utf8_binary, ' ', '') FROM (VALUES ('xbc '), ('xbc '), ('a'), ('xbc'))) SELECT len(c1), regexp_count(c1, 'a'), regexp_count(c1, 'xbc') FROM t
132146 -- !query analysis
147+ diff --git a/sql/core/src/test/resources/sql-tests/inputs/charvarchar.sql b/sql/core/src/test/resources/sql-tests/inputs/charvarchar.sql
148+ index be038e1083c..b3de0ee2641 100644
149+ --- a/sql/core/src/test/resources/sql-tests/inputs/charvarchar.sql
150+ +++ b/sql/core/src/test/resources/sql-tests/inputs/charvarchar.sql
151+ @@ -1,3 +1,6 @@
152+ + -- TODO: support empty table write / CTAS in native parquet writer
153+ + --SET spark.comet.parquet.write.enabled = false
154+ +
155+ create table char_tbl(c char(5), v varchar(6)) using parquet;
156+ desc formatted char_tbl;
157+ desc formatted char_tbl c;
158+ @@ -124,3 +127,5 @@ select chr(167), chr(247), chr(215);
159+ SELECT to_varchar(78.12, '$99.99');
160+ SELECT to_varchar(111.11, '99.9');
161+ SELECT to_varchar(12454.8, '99,999.9S');
162+ +
163+ + SET spark.comet.parquet.write.enabled = true;
133164diff --git a/sql/core/src/test/resources/sql-tests/inputs/collations.sql b/sql/core/src/test/resources/sql-tests/inputs/collations.sql
134165index 17815ed5dde..baad440b1ce 100644
135166--- a/sql/core/src/test/resources/sql-tests/inputs/collations.sql
@@ -312,6 +343,22 @@ index 21a3ce1e122..f4762ab98f0 100644
312343 SET spark.sql.ansi.enabled = false;
313344
314345 -- In COMPENSATION views get invalidated if the type can't cast
346+ diff --git a/sql/core/src/test/resources/sql-tests/results/charvarchar.sql.out b/sql/core/src/test/resources/sql-tests/results/charvarchar.sql.out
347+ index 3026e463947..bf3f20906f1 100644
348+ --- a/sql/core/src/test/resources/sql-tests/results/charvarchar.sql.out
349+ +++ b/sql/core/src/test/resources/sql-tests/results/charvarchar.sql.out
350+ @@ -1254,3 +1254,11 @@ SELECT to_varchar(12454.8, '99,999.9S')
351+ struct<to_char(12454.8, 99,999.9S):string>
352+ -- !query output
353+ 12,454.8+
354+ +
355+ +
356+ + -- !query
357+ + SET spark.comet.parquet.write.enabled = true
358+ + -- !query schema
359+ + struct<key:string,value:string>
360+ + -- !query output
361+ + spark.comet.parquet.write.enabled true
315362diff --git a/sql/core/src/test/resources/sql-tests/results/listagg-collations.sql.out b/sql/core/src/test/resources/sql-tests/results/listagg-collations.sql.out
316363index 1f8c5822e7d..b7de4e28813 100644
317364--- a/sql/core/src/test/resources/sql-tests/results/listagg-collations.sql.out
@@ -2506,6 +2553,64 @@ index 272be70f9fe..06957694002 100644
25062553 }.isEmpty)
25072554 assert(collect(initialExecutedPlan) {
25082555 case i: InMemoryTableScanLike => i
2556+ diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/CharVarcharDDLTestBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/CharVarcharDDLTestBase.scala
2557+ index a5bb3058bed..de51b21f21a 100644
2558+ --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/CharVarcharDDLTestBase.scala
2559+ +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/CharVarcharDDLTestBase.scala
2560+ @@ -18,7 +18,7 @@
2561+ package org.apache.spark.sql.execution.command
2562+
2563+ import org.apache.spark.SparkConf
2564+ - import org.apache.spark.sql.{AnalysisException, QueryTest, Row}
2565+ + import org.apache.spark.sql.{AnalysisException, IgnoreComet, QueryTest, Row}
2566+ import org.apache.spark.sql.catalyst.util.CharVarcharUtils
2567+ import org.apache.spark.sql.connector.catalog.InMemoryPartitionTableCatalog
2568+ import org.apache.spark.sql.internal.SQLConf
2569+ @@ -150,7 +150,9 @@ trait CharVarcharDDLTestBase extends QueryTest with SQLTestUtils {
2570+ }
2571+ }
2572+
2573+ - test("SPARK-33901: ctas should should not change table's schema") {
2574+ + // TODO support CTAS in comet native parquet writer
2575+ + test("SPARK-33901: ctas should should not change table's schema",
2576+ + IgnoreComet("comet native writer does not support empty dir / table creation yet")) {
2577+ withTable("t1", "t2") {
2578+ sql(s"CREATE TABLE t1(i CHAR(5), c VARCHAR(4)) USING $format")
2579+ sql(s"CREATE TABLE t2 USING $format AS SELECT * FROM t1")
2580+ @@ -167,7 +169,8 @@ trait CharVarcharDDLTestBase extends QueryTest with SQLTestUtils {
2581+ }
2582+ }
2583+
2584+ - test("SPARK-37160: CREATE TABLE AS SELECT with CHAR_AS_VARCHAR") {
2585+ + test("SPARK-37160: CREATE TABLE AS SELECT with CHAR_AS_VARCHAR",
2586+ + IgnoreComet("comet native writer does not support empty dir/table creation yet")) {
2587+ withTable("t1", "t2") {
2588+ sql(s"CREATE TABLE t1(col CHAR(5)) USING $format")
2589+ checkTableSchemaTypeStr("t1", Seq(Row("char(5)")))
2590+ diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileFormatWriterSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileFormatWriterSuite.scala
2591+ index 343b59a311e..05f3cab13f9 100644
2592+ --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileFormatWriterSuite.scala
2593+ +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileFormatWriterSuite.scala
2594+ @@ -17,7 +17,7 @@
2595+
2596+ package org.apache.spark.sql.execution.datasources
2597+
2598+ - import org.apache.spark.sql.{QueryTest, Row}
2599+ + import org.apache.spark.sql.{IgnoreComet, QueryTest, Row}
2600+ import org.apache.spark.sql.catalyst.plans.CodegenInterpretedPlanTest
2601+ import org.apache.spark.sql.test.SharedSparkSession
2602+
2603+ @@ -28,7 +28,9 @@ class FileFormatWriterSuite
2604+
2605+ import testImplicits._
2606+
2607+ - test("empty file should be skipped while write to file") {
2608+ + // TODO :: comet native write does not write empty files / dirs
2609+ + test("empty file should be skipped while write to file",
2610+ + IgnoreComet("comet native writer does not create empty files / dir")) {
2611+ withTempPath { path =>
2612+ spark.range(100).repartition(10).where("id = 50").write.parquet(path.toString)
2613+ val partFiles = path.listFiles()
25092614diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/SchemaPruningSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/SchemaPruningSuite.scala
25102615index 0a0b23d1e60..5685926250f 100644
25112616--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/SchemaPruningSuite.scala
@@ -3314,6 +3419,62 @@ index c5c56f081d8..197cd241f48 100644
33143419 assert(bucketedScan.length == expectedNumBucketedScan)
33153420 }
33163421
3422+ diff --git a/sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala
3423+ index baf99798965..e23d8223e05 100644
3424+ --- a/sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala
3425+ +++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala
3426+ @@ -263,7 +263,8 @@ class InsertSuite extends DataSourceTest with SharedSparkSession {
3427+ }
3428+ }
3429+
3430+ - test("INSERT INTO TABLE - complex type but different names") {
3431+ + test("INSERT INTO TABLE - complex type but different names",
3432+ + IgnoreComet("comet native writer issue")) {
3433+ val tab1 = "tab1"
3434+ val tab2 = "tab2"
3435+ withTable(tab1, tab2) {
3436+ @@ -1002,7 +1003,8 @@ class InsertSuite extends DataSourceTest with SharedSparkSession {
3437+ }
3438+ }
3439+
3440+ - test("SPARK-38336 INSERT INTO statements with tables with default columns: positive tests") {
3441+ + test("SPARK-38336 INSERT INTO statements with tables with default columns: positive tests",
3442+ + IgnoreComet("comet native writer insert overwrite bug")) {
3443+ // When the INSERT INTO statement provides fewer values than expected, NULL values are appended
3444+ // in their place.
3445+ withTable("t") {
3446+ @@ -1517,7 +1519,8 @@ class InsertSuite extends DataSourceTest with SharedSparkSession {
3447+ }
3448+ }
3449+
3450+ - test("SPARK-38811 INSERT INTO on columns added with ALTER TABLE ADD COLUMNS: Positive tests") {
3451+ + test("SPARK-38811 INSERT INTO on columns added with ALTER TABLE ADD COLUMNS: Positive tests",
3452+ + IgnoreComet("bug with insert overwrite mode comet native writer")) {
3453+ // There is a complex expression in the default value.
3454+ val createTableBooleanCol = "create table t(i boolean) using parquet"
3455+ val createTableIntCol = "create table t(i int) using parquet"
3456+ @@ -2331,7 +2334,9 @@ class InsertSuite extends DataSourceTest with SharedSparkSession {
3457+ }
3458+ }
3459+
3460+ - test("SPARK-43071: INSERT INTO from queries whose final operators are not projections") {
3461+ + // TODO : fix overwrite mode issues comet native writer
3462+ + test("SPARK-43071: INSERT INTO from queries whose final operators are not projections",
3463+ + IgnoreComet("comet writer issues with insert overwrite")) {
3464+ def runTest(insert: String, expected: Seq[Row]): Unit = {
3465+ withTable("t1", "t2") {
3466+ sql("create table t1(i boolean, s bigint default 42) using parquet")
3467+ @@ -2399,7 +2404,9 @@ class InsertSuite extends DataSourceTest with SharedSparkSession {
3468+ }
3469+ }
3470+
3471+ - test("SPARK-29174 Support LOCAL in INSERT OVERWRITE DIRECTORY to data source") {
3472+ + // TODO : Insert overwrite not supported comet native writer
3473+ + test("SPARK-29174 Support LOCAL in INSERT OVERWRITE DIRECTORY to data source",
3474+ + IgnoreComet("comet native writer does not support insert overwrite")) {
3475+ withTempPath { dir =>
3476+ val path = dir.toURI.getPath
3477+ sql(s"""create table tab1 ( a int) using parquet location '$path'""")
33173478diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSinkSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSinkSuite.scala
33183479index 9742a004545..4e0417d730a 100644
33193480--- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSinkSuite.scala
@@ -3494,6 +3655,33 @@ index 86c4e49f6f6..2e639e5f38d 100644
34943655 val tblSourceName = "tbl_src"
34953656 val tblTargetName = "tbl_target"
34963657 val tblSourceQualified = s"default.$tblSourceName"
3658+ diff --git a/sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala
3659+ index 300807cf058..8dab4f9a2af 100644
3660+ --- a/sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala
3661+ +++ b/sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala
3662+ @@ -620,7 +620,10 @@ class DataFrameReaderWriterSuite extends QueryTest with SharedSparkSession with
3663+ Option(dir).map(spark.read.format("org.apache.spark.sql.test").load)
3664+ }
3665+
3666+ - test("write path implements onTaskCommit API correctly") {
3667+ +
3668+ + // TODO : fix test for native writer
3669+ + test("write path implements onTaskCommit API correctly",
3670+ + IgnoreComet("Comet native writer partial support")) {
3671+ withSQLConf(
3672+ SQLConf.FILE_COMMIT_PROTOCOL_CLASS.key ->
3673+ classOf[MessageCapturingCommitProtocol].getCanonicalName) {
3674+ @@ -1184,7 +1187,9 @@ class DataFrameReaderWriterSuite extends QueryTest with SharedSparkSession with
3675+ }
3676+ }
3677+
3678+ - test("Insert overwrite table command should output correct schema: basic") {
3679+ + // TODO : support vairous write modes in comet native writer
3680+ + test("Insert overwrite table command should output correct schema: basic",
3681+ + IgnoreComet("Comet native writer does not supportinsert overwrite mode")) {
3682+ withTable("tbl", "tbl2") {
3683+ withView("view1") {
3684+ val df = spark.range(10).toDF("id")
34973685diff --git a/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala b/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala
34983686index f0f3f94b811..fd9744a58cf 100644
34993687--- a/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala
0 commit comments