Skip to content

Commit 846ad25

Browse files
author
B Vadlamani
committed
enable_spark_tests_comet_native_writer
1 parent 3cace35 commit 846ad25

2 files changed

Lines changed: 268 additions & 0 deletions

File tree

dev/diffs/3.4.3.diff

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,6 +1872,62 @@ index 593bd7bb4ba..32af28b0238 100644
18721872
}
18731873
assert(shuffles2.size == 4)
18741874
val smj2 = findTopLevelSortMergeJoin(adaptive2)
1875+
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
1876+
index f77b6336b81..b703603d26b 100644
1877+
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/CharVarcharDDLTestBase.scala
1878+
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/CharVarcharDDLTestBase.scala
1879+
@@ -18,7 +18,7 @@
1880+
package org.apache.spark.sql.execution.command
1881+
1882+
import org.apache.spark.SparkConf
1883+
-import org.apache.spark.sql.{AnalysisException, QueryTest, Row}
1884+
+import org.apache.spark.sql.{AnalysisException, IgnoreComet, QueryTest, Row}
1885+
import org.apache.spark.sql.catalyst.util.CharVarcharUtils
1886+
import org.apache.spark.sql.connector.catalog.InMemoryPartitionTableCatalog
1887+
import org.apache.spark.sql.internal.SQLConf
1888+
@@ -112,7 +112,8 @@ trait CharVarcharDDLTestBase extends QueryTest with SQLTestUtils {
1889+
}
1890+
}
1891+
1892+
- test("SPARK-33901: ctas should should not change table's schema") {
1893+
+ test("SPARK-33901: ctas should should not change table's schema",
1894+
+ IgnoreComet("comet native writer does not support empty dir / table creation yet")) {
1895+
withTable("t1", "t2") {
1896+
sql(s"CREATE TABLE t1(i CHAR(5), c VARCHAR(4)) USING $format")
1897+
sql(s"CREATE TABLE t2 USING $format AS SELECT * FROM t1")
1898+
@@ -129,7 +130,8 @@ trait CharVarcharDDLTestBase extends QueryTest with SQLTestUtils {
1899+
}
1900+
}
1901+
1902+
- test("SPARK-37160: CREATE TABLE AS SELECT with CHAR_AS_VARCHAR") {
1903+
+ test("SPARK-37160: CREATE TABLE AS SELECT with CHAR_AS_VARCHAR",
1904+
+ IgnoreComet("comet native writer does not support empty dir/table creation yet")) {
1905+
withTable("t1", "t2") {
1906+
sql(s"CREATE TABLE t1(col CHAR(5)) USING $format")
1907+
checkTableSchemaTypeStr("t1", Seq(Row("char(5)")))
1908+
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
1909+
index 343b59a311e..9d5789c1d91 100644
1910+
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileFormatWriterSuite.scala
1911+
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileFormatWriterSuite.scala
1912+
@@ -17,7 +17,7 @@
1913+
1914+
package org.apache.spark.sql.execution.datasources
1915+
1916+
-import org.apache.spark.sql.{QueryTest, Row}
1917+
+import org.apache.spark.sql.{IgnoreComet, QueryTest, Row}
1918+
import org.apache.spark.sql.catalyst.plans.CodegenInterpretedPlanTest
1919+
import org.apache.spark.sql.test.SharedSparkSession
1920+
1921+
@@ -28,7 +28,8 @@ class FileFormatWriterSuite
1922+
1923+
import testImplicits._
1924+
1925+
- test("empty file should be skipped while write to file") {
1926+
+ test("empty file should be skipped while write to file",
1927+
+ IgnoreComet("comet native writer does not create empty files / dir")) {
1928+
withTempPath { path =>
1929+
spark.range(100).repartition(10).where("id = 50").write.parquet(path.toString)
1930+
val partFiles = path.listFiles()
18751931
diff --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
18761932
index bd9c79e5b96..2ada8c28842 100644
18771933
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/SchemaPruningSuite.scala
@@ -2662,6 +2718,60 @@ index 1f55742cd67..42377f7cf26 100644
26622718
assert(bucketedScan.length == expectedNumBucketedScan)
26632719
}
26642720

2721+
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
2722+
index 2207661478d..dc4e4b4240c 100644
2723+
--- a/sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala
2724+
+++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala
2725+
@@ -237,7 +237,8 @@ class InsertSuite extends DataSourceTest with SharedSparkSession {
2726+
}
2727+
}
2728+
2729+
- test("INSERT INTO TABLE - complex type but different names") {
2730+
+ test("INSERT INTO TABLE - complex type but different names",
2731+
+ IgnoreComet("comet native writer issue")) {
2732+
val tab1 = "tab1"
2733+
val tab2 = "tab2"
2734+
withTable(tab1, tab2) {
2735+
@@ -889,7 +890,8 @@ class InsertSuite extends DataSourceTest with SharedSparkSession {
2736+
assert(message.contains("target table has 2 column(s) but the inserted data has 1 column(s)"))
2737+
}
2738+
2739+
- test("SPARK-38336 INSERT INTO statements with tables with default columns: positive tests") {
2740+
+ test("SPARK-38336 INSERT INTO statements with tables with default columns: positive tests",
2741+
+ IgnoreComet("comet native writer insert overwrite bug")) {
2742+
// When the USE_NULLS_FOR_MISSING_DEFAULT_COLUMN_VALUES configuration is enabled, and no
2743+
// explicit DEFAULT value is available when the INSERT INTO statement provides fewer
2744+
// values than expected, NULL values are appended in their place.
2745+
@@ -1286,7 +1288,8 @@ class InsertSuite extends DataSourceTest with SharedSparkSession {
2746+
}
2747+
}
2748+
2749+
- test("SPARK-38811 INSERT INTO on columns added with ALTER TABLE ADD COLUMNS: Positive tests") {
2750+
+ test("SPARK-38811 INSERT INTO on columns added with ALTER TABLE ADD COLUMNS: Positive tests",
2751+
+ IgnoreComet("bug with insert overwrite mode comet native writer")) {
2752+
// There is a complex expression in the default value.
2753+
val createTableBooleanCol = "create table t(i boolean) using parquet"
2754+
val createTableIntCol = "create table t(i int) using parquet"
2755+
@@ -1984,7 +1987,8 @@ class InsertSuite extends DataSourceTest with SharedSparkSession {
2756+
}
2757+
}
2758+
2759+
- test("SPARK-43071: INSERT INTO from queries whose final operators are not projections") {
2760+
+ test("SPARK-43071: INSERT INTO from queries whose final operators are not projections",
2761+
+ IgnoreComet("comet writer issues with insert overwrite")) {
2762+
def runTest(insert: String, expected: Seq[Row]): Unit = {
2763+
withTable("t1", "t2") {
2764+
sql("create table t1(i boolean, s bigint default 42) using parquet")
2765+
@@ -2052,7 +2056,8 @@ class InsertSuite extends DataSourceTest with SharedSparkSession {
2766+
}
2767+
}
2768+
2769+
- test("SPARK-29174 Support LOCAL in INSERT OVERWRITE DIRECTORY to data source") {
2770+
+ test("SPARK-29174 Support LOCAL in INSERT OVERWRITE DIRECTORY to data source",
2771+
+ IgnoreComet("comet native writer does not support insert overwrite")) {
2772+
withTempPath { dir =>
2773+
val path = dir.toURI.getPath
2774+
sql(s"""create table tab1 ( a int) using parquet location '$path'""")
26652775
diff --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
26662776
index 75f440caefc..36b1146bc3a 100644
26672777
--- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSinkSuite.scala
@@ -2832,6 +2942,30 @@ index abe606ad9c1..2d930b64cca 100644
28322942
val tblSourceName = "tbl_src"
28332943
val tblTargetName = "tbl_target"
28342944
val tblSourceQualified = s"default.$tblSourceName"
2945+
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
2946+
index 44c9fbadfac..5f98bb9be17 100644
2947+
--- a/sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala
2948+
+++ b/sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala
2949+
@@ -519,7 +519,8 @@ class DataFrameReaderWriterSuite extends QueryTest with SharedSparkSession with
2950+
Option(dir).map(spark.read.format("org.apache.spark.sql.test").load)
2951+
}
2952+
2953+
- test("write path implements onTaskCommit API correctly") {
2954+
+ test("write path implements onTaskCommit API correctly",
2955+
+ IgnoreComet("Comet native writer partial support")) {
2956+
withSQLConf(
2957+
SQLConf.FILE_COMMIT_PROTOCOL_CLASS.key ->
2958+
classOf[MessageCapturingCommitProtocol].getCanonicalName) {
2959+
@@ -1069,7 +1070,8 @@ class DataFrameReaderWriterSuite extends QueryTest with SharedSparkSession with
2960+
}
2961+
}
2962+
2963+
- test("Insert overwrite table command should output correct schema: basic") {
2964+
+ test("Insert overwrite table command should output correct schema: basic",
2965+
+ IgnoreComet("Comet native writer does not supportinsert overwrite mode")) {
2966+
withTable("tbl", "tbl2") {
2967+
withView("view1") {
2968+
val df = spark.range(10).toDF("id")
28352969
diff --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
28362970
index dd55fcfe42c..e898fc33bab 100644
28372971
--- a/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala

dev/diffs/3.5.8.diff

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,6 +1876,62 @@ index 2f8e401e743..a4f94417dcc 100644
18761876
plan.inputPlan.output.zip(plan.finalPhysicalPlan.output).foreach { case (o1, o2) =>
18771877
assert(o1.semanticEquals(o2), "Different output column order after AQE optimization")
18781878
}
1879+
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
1880+
index 12d5870309f..51429bf4039 100644
1881+
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/CharVarcharDDLTestBase.scala
1882+
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/CharVarcharDDLTestBase.scala
1883+
@@ -18,7 +18,7 @@
1884+
package org.apache.spark.sql.execution.command
1885+
1886+
import org.apache.spark.SparkConf
1887+
-import org.apache.spark.sql.{AnalysisException, QueryTest, Row}
1888+
+import org.apache.spark.sql.{AnalysisException, IgnoreComet, QueryTest, Row}
1889+
import org.apache.spark.sql.catalyst.util.CharVarcharUtils
1890+
import org.apache.spark.sql.connector.catalog.InMemoryPartitionTableCatalog
1891+
import org.apache.spark.sql.internal.SQLConf
1892+
@@ -162,7 +162,8 @@ trait CharVarcharDDLTestBase extends QueryTest with SQLTestUtils {
1893+
}
1894+
}
1895+
1896+
- test("SPARK-33901: ctas should should not change table's schema") {
1897+
+ test("SPARK-33901: ctas should should not change table's schema",
1898+
+ IgnoreComet("comet native writer does not support empty dir / table creation yet")) {
1899+
withTable("t1", "t2") {
1900+
sql(s"CREATE TABLE t1(i CHAR(5), c VARCHAR(4)) USING $format")
1901+
sql(s"CREATE TABLE t2 USING $format AS SELECT * FROM t1")
1902+
@@ -179,7 +180,8 @@ trait CharVarcharDDLTestBase extends QueryTest with SQLTestUtils {
1903+
}
1904+
}
1905+
1906+
- test("SPARK-37160: CREATE TABLE AS SELECT with CHAR_AS_VARCHAR") {
1907+
+ test("SPARK-37160: CREATE TABLE AS SELECT with CHAR_AS_VARCHAR",
1908+
+ IgnoreComet("comet native writer does not support empty dir/table creation yet")) {
1909+
withTable("t1", "t2") {
1910+
sql(s"CREATE TABLE t1(col CHAR(5)) USING $format")
1911+
checkTableSchemaTypeStr("t1", Seq(Row("char(5)")))
1912+
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
1913+
index 343b59a311e..9d5789c1d91 100644
1914+
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileFormatWriterSuite.scala
1915+
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileFormatWriterSuite.scala
1916+
@@ -17,7 +17,7 @@
1917+
1918+
package org.apache.spark.sql.execution.datasources
1919+
1920+
-import org.apache.spark.sql.{QueryTest, Row}
1921+
+import org.apache.spark.sql.{IgnoreComet, QueryTest, Row}
1922+
import org.apache.spark.sql.catalyst.plans.CodegenInterpretedPlanTest
1923+
import org.apache.spark.sql.test.SharedSparkSession
1924+
1925+
@@ -28,7 +28,8 @@ class FileFormatWriterSuite
1926+
1927+
import testImplicits._
1928+
1929+
- test("empty file should be skipped while write to file") {
1930+
+ test("empty file should be skipped while write to file",
1931+
+ IgnoreComet("comet native writer does not create empty files / dir")) {
1932+
withTempPath { path =>
1933+
spark.range(100).repartition(10).where("id = 50").write.parquet(path.toString)
1934+
val partFiles = path.listFiles()
18791935
diff --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
18801936
index bf496d6db21..9bb57a9b4c6 100644
18811937
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/SchemaPruningSuite.scala
@@ -2657,6 +2713,60 @@ index d675503a8ba..659fa686fb7 100644
26572713
assert(bucketedScan.length == expectedNumBucketedScan)
26582714
}
26592715

2716+
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
2717+
index 7b1a5a32037..f163a9733a5 100644
2718+
--- a/sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala
2719+
+++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala
2720+
@@ -262,7 +262,8 @@ class InsertSuite extends DataSourceTest with SharedSparkSession {
2721+
}
2722+
}
2723+
2724+
- test("INSERT INTO TABLE - complex type but different names") {
2725+
+ test("INSERT INTO TABLE - complex type but different names",
2726+
+ IgnoreComet("comet native writer issue")) {
2727+
val tab1 = "tab1"
2728+
val tab2 = "tab2"
2729+
withTable(tab1, tab2) {
2730+
@@ -997,7 +998,8 @@ class InsertSuite extends DataSourceTest with SharedSparkSession {
2731+
}
2732+
}
2733+
2734+
- test("SPARK-38336 INSERT INTO statements with tables with default columns: positive tests") {
2735+
+ test("SPARK-38336 INSERT INTO statements with tables with default columns: positive tests",
2736+
+ IgnoreComet("comet native writer insert overwrite bug")) {
2737+
// When the INSERT INTO statement provides fewer values than expected, NULL values are appended
2738+
// in their place.
2739+
withTable("t") {
2740+
@@ -1470,7 +1472,8 @@ class InsertSuite extends DataSourceTest with SharedSparkSession {
2741+
}
2742+
}
2743+
2744+
- test("SPARK-38811 INSERT INTO on columns added with ALTER TABLE ADD COLUMNS: Positive tests") {
2745+
+ test("SPARK-38811 INSERT INTO on columns added with ALTER TABLE ADD COLUMNS: Positive tests",
2746+
+ IgnoreComet("bug with insert overwrite mode comet native writer")) {
2747+
// There is a complex expression in the default value.
2748+
val createTableBooleanCol = "create table t(i boolean) using parquet"
2749+
val createTableIntCol = "create table t(i int) using parquet"
2750+
@@ -2263,7 +2266,8 @@ class InsertSuite extends DataSourceTest with SharedSparkSession {
2751+
}
2752+
}
2753+
2754+
- test("SPARK-43071: INSERT INTO from queries whose final operators are not projections") {
2755+
+ test("SPARK-43071: INSERT INTO from queries whose final operators are not projections",
2756+
+ IgnoreComet("comet writer issues with insert overwrite")) {
2757+
def runTest(insert: String, expected: Seq[Row]): Unit = {
2758+
withTable("t1", "t2") {
2759+
sql("create table t1(i boolean, s bigint default 42) using parquet")
2760+
@@ -2331,7 +2335,8 @@ class InsertSuite extends DataSourceTest with SharedSparkSession {
2761+
}
2762+
}
2763+
2764+
- test("SPARK-29174 Support LOCAL in INSERT OVERWRITE DIRECTORY to data source") {
2765+
+ test("SPARK-29174 Support LOCAL in INSERT OVERWRITE DIRECTORY to data source",
2766+
+ IgnoreComet("comet native writer does not support insert overwrite")) {
2767+
withTempPath { dir =>
2768+
val path = dir.toURI.getPath
2769+
sql(s"""create table tab1 ( a int) using parquet location '$path'""")
26602770
diff --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
26612771
index 1954cce7fdc..73d1464780e 100644
26622772
--- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSinkSuite.scala
@@ -2814,6 +2924,30 @@ index abe606ad9c1..2d930b64cca 100644
28142924
val tblSourceName = "tbl_src"
28152925
val tblTargetName = "tbl_target"
28162926
val tblSourceQualified = s"default.$tblSourceName"
2927+
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
2928+
index b40f9210a68..34aa6287eb5 100644
2929+
--- a/sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala
2930+
+++ b/sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala
2931+
@@ -538,7 +538,8 @@ class DataFrameReaderWriterSuite extends QueryTest with SharedSparkSession with
2932+
Option(dir).map(spark.read.format("org.apache.spark.sql.test").load)
2933+
}
2934+
2935+
- test("write path implements onTaskCommit API correctly") {
2936+
+ test("write path implements onTaskCommit API correctly",
2937+
+ IgnoreComet("Comet native writer partial support")) {
2938+
withSQLConf(
2939+
SQLConf.FILE_COMMIT_PROTOCOL_CLASS.key ->
2940+
classOf[MessageCapturingCommitProtocol].getCanonicalName) {
2941+
@@ -1088,7 +1089,8 @@ class DataFrameReaderWriterSuite extends QueryTest with SharedSparkSession with
2942+
}
2943+
}
2944+
2945+
- test("Insert overwrite table command should output correct schema: basic") {
2946+
+ test("Insert overwrite table command should output correct schema: basic",
2947+
+ IgnoreComet("Comet native writer does not supportinsert overwrite mode")) {
2948+
withTable("tbl", "tbl2") {
2949+
withView("view1") {
2950+
val df = spark.range(10).toDF("id")
28172951
diff --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
28182952
index e937173a590..5fede1579f7 100644
28192953
--- a/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala

0 commit comments

Comments
 (0)