rich7420 commented on code in PR #7130:
URL: https://github.com/apache/datafusion-comet/pull/7130#discussion_r4704181323


##########
spark/src/test/resources/sql-tests/iceberg/case_sensitive_columns.sql:
##########
@@ -0,0 +1,85 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--   http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+-- `a` and `A` each bind their own field: 
https://github.com/apache/datafusion-comet/issues/5540
+
+-- No Iceberg spark-runtime is published for Spark 4.2 yet, and the 4.0 
runtime the build reuses
+-- is binary-incompatible with it. See 
https://github.com/apache/datafusion-comet/issues/4969.
+-- MaxSparkVersion: 4.1
+
+-- Config: spark.sql.catalog.test_cat=org.apache.iceberg.spark.SparkCatalog
+-- Config: spark.sql.catalog.test_cat.type=hadoop
+-- Config: spark.sql.catalog.test_cat.warehouse=/tmp/comet-iceberg-sql-test
+-- Config: spark.comet.enabled=true
+-- Config: spark.comet.exec.enabled=true
+-- Config: spark.comet.scan.icebergNative.enabled=true
+-- Config: spark.sql.caseSensitive=true
+
+statement
+DROP TABLE IF EXISTS test_cat.db.case_pair
+
+statement
+CREATE TABLE test_cat.db.case_pair (a INT, A INT) USING iceberg

Review Comment:
   Could this fixture also cover `s STRUCT<a: INT, A: INT>`? Reverting 
`case_sensitive` gave me a duplicate-field error on `SELECT id, s`.



##########
spark/src/test/scala/org/apache/comet/CometIcebergNativeSuite.scala:
##########
@@ -1663,6 +1663,379 @@ class CometIcebergNativeSuite
     }
   }
 
+  /** Returns one message per query failing [[checkIcebergNativeScan]], so all 
are reported. */
+  private def failingNativeScanChecks(queries: Seq[String]): Seq[String] =
+    queries.flatMap { q =>
+      try {
+        checkIcebergNativeScan(q)
+        None
+      } catch {
+        case scala.util.control.NonFatal(e) =>
+          val plan =
+            try spark.sql(q).queryExecution.executedPlan.toString
+            catch { case scala.util.control.NonFatal(pe) => s"<plan failed: 
${pe.getMessage}>" }
+          Some(s"QUERY: $q\nERROR: ${e.getMessage}\nPLAN:\n$plan")
+      }
+    }
+
+  private def withCaseCatalog(warehouseDir: File, caseSensitive: Boolean)(f: 
=> Unit): Unit =
+    withSQLConf(
+      "spark.sql.catalog.case_cat" -> "org.apache.iceberg.spark.SparkCatalog",
+      "spark.sql.catalog.case_cat.type" -> "hadoop",
+      "spark.sql.catalog.case_cat.warehouse" -> warehouseDir.getAbsolutePath,
+      SQLConf.CASE_SENSITIVE.key -> caseSensitive.toString,
+      CometConf.COMET_ENABLED.key -> "true",
+      CometConf.COMET_EXEC_ENABLED.key -> "true",
+      CometConf.COMET_ICEBERG_NATIVE_ENABLED.key -> "true")(f)
+
+  private def importParquetInto(
+      table: org.apache.iceberg.Table,
+      sourceTable: String,
+      stagingDir: String): Unit =
+    Class
+      .forName("org.apache.iceberg.spark.SparkTableUtil")
+      .getMethod(
+        "importSparkTable",
+        classOf[org.apache.spark.sql.SparkSession],
+        classOf[org.apache.spark.sql.catalyst.TableIdentifier],
+        classOf[org.apache.iceberg.Table],
+        classOf[String])
+      .invoke(
+        null,
+        spark,
+        new org.apache.spark.sql.catalyst.TableIdentifier(sourceTable),
+        table,
+        stagingDir)
+
+  test("issue 5540: equality deletes keyed on columns a and A") {

Review Comment:
   Could the comment on the earlier equality-delete test (line 1579) be 
updated? It still says reading both columns is rejected, but that works now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to