You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by co...@apache.org on 2025/08/28 16:04:17 UTC

(datafusion-comet) branch main updated: chore: fix struct to string test for `native_iceberg_compat` (#2253)

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

comphead pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-comet.git


The following commit(s) were added to refs/heads/main by this push:
     new 200965573 chore: fix struct to string test for `native_iceberg_compat` (#2253)
200965573 is described below

commit 2009655731433b5d90b6d57e43b3f7bc620d759e
Author: Oleks V <co...@users.noreply.github.com>
AuthorDate: Thu Aug 28 09:04:13 2025 -0700

    chore: fix struct to string test for `native_iceberg_compat` (#2253)
    
    * chore: Fix struct to string test
---
 .../scala/org/apache/comet/CometCastSuite.scala    | 47 ++++++++++------------
 1 file changed, 22 insertions(+), 25 deletions(-)

diff --git a/spark/src/test/scala/org/apache/comet/CometCastSuite.scala b/spark/src/test/scala/org/apache/comet/CometCastSuite.scala
index 04b5fd164..070d6d781 100644
--- a/spark/src/test/scala/org/apache/comet/CometCastSuite.scala
+++ b/spark/src/test/scala/org/apache/comet/CometCastSuite.scala
@@ -945,31 +945,28 @@ class CometCastSuite extends CometTestBase with AdaptiveSparkPlanHelper {
   // Complex Types
 
   test("cast StructType to StringType") {
-    // TODO test fails if scan is auto
-    // https://github.com/apache/datafusion-comet/issues/2175
-    withSQLConf(CometConf.COMET_NATIVE_SCAN_IMPL.key -> CometConf.SCAN_NATIVE_COMET) {
-      Seq(true, false).foreach { dictionaryEnabled =>
-        withTempDir { dir =>
-          val path = new Path(dir.toURI.toString, "test.parquet")
-          makeParquetFileAllPrimitiveTypes(path, dictionaryEnabled = dictionaryEnabled, 10000)
-          withParquetTable(path.toString, "tbl") {
-            // primitives
-            checkSparkAnswerAndOperator(
-              "SELECT CAST(struct(_1, _2, _3, _4, _5, _6, _7, _8) as string) FROM tbl")
-            checkSparkAnswerAndOperator(
-              "SELECT CAST(struct(_9, _10, _11, _12) as string) FROM tbl")
-            // decimals
-            // TODO add _16 when https://github.com/apache/datafusion-comet/issues/1068 is resolved
-            checkSparkAnswerAndOperator("SELECT CAST(struct(_15, _17) as string) FROM tbl")
-            // dates & timestamps
-            checkSparkAnswerAndOperator("SELECT CAST(struct(_18, _19, _20) as string) FROM tbl")
-            // named struct
-            checkSparkAnswerAndOperator(
-              "SELECT CAST(named_struct('a', _1, 'b', _2) as string) FROM tbl")
-            // nested struct
-            checkSparkAnswerAndOperator(
-              "SELECT CAST(named_struct('a', named_struct('b', _1, 'c', _2)) as string) FROM tbl")
-          }
+    Seq(true, false).foreach { dictionaryEnabled =>
+      withTempDir { dir =>
+        val path = new Path(dir.toURI.toString, "test.parquet")
+        makeParquetFileAllPrimitiveTypes(path, dictionaryEnabled = dictionaryEnabled, 10000)
+        withParquetTable(path.toString, "tbl") {
+          // primitives
+          checkSparkAnswerAndOperator(
+            "SELECT CAST(struct(_1, _2, _3, _4, _5, _6, _7, _8) as string) FROM tbl")
+          // the same field, add _11 and _12 again when
+          // https://github.com/apache/datafusion-comet/issues/2256 resolved
+          checkSparkAnswerAndOperator("SELECT CAST(struct(_11, _12) as string) FROM tbl")
+          // decimals
+          // TODO add _16 when https://github.com/apache/datafusion-comet/issues/1068 is resolved
+          checkSparkAnswerAndOperator("SELECT CAST(struct(_15, _17) as string) FROM tbl")
+          // dates & timestamps
+          checkSparkAnswerAndOperator("SELECT CAST(struct(_18, _19, _20) as string) FROM tbl")
+          // named struct
+          checkSparkAnswerAndOperator(
+            "SELECT CAST(named_struct('a', _1, 'b', _2) as string) FROM tbl")
+          // nested struct
+          checkSparkAnswerAndOperator(
+            "SELECT CAST(named_struct('a', named_struct('b', _1, 'c', _2)) as string) FROM tbl")
         }
       }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org