coderfender commented on code in PR #3369:
URL: https://github.com/apache/datafusion-comet/pull/3369#discussion_r2757459697


##########
spark/src/test/scala/org/apache/comet/CometMapExpressionSuite.scala:
##########
@@ -157,4 +157,48 @@ class CometMapExpressionSuite extends CometTestBase {
     }
   }
 
+  test("map_contains_key") {
+    withTempDir { dir =>
+      val path = new Path(dir.toURI.toString, "test.parquet")
+      val filename = path.toString
+      val random = new Random(42)
+      withSQLConf(CometConf.COMET_ENABLED.key -> "false") {
+        val schemaGenOptions =
+          SchemaGenOptions(generateArray = true, generateStruct = false, 
generateMap = true)
+        val dataGenOptions = DataGenOptions(allowNull = false, 
generateNegativeZero = false)
+        ParquetGenerator.makeParquetFile(
+          random,
+          spark,
+          filename,
+          100,
+          schemaGenOptions,
+          dataGenOptions)
+      }
+      spark.read.parquet(filename).createOrReplaceTempView("t1")
+
+      checkSparkAnswer(
+        spark.sql("SELECT map_contains_key(c14, element_at(map_keys(c14), 1)) 
FROM t1"))
+      checkSparkAnswer(spark.sql("SELECT map_contains_key(c14, 999999) FROM 
t1"))

Review Comment:
   `checkSparkAnswerAndOperator` checks if all the operators are comet native 
vs `checkSparkAnswer` which only validates the result DF. Any reason why we 
used the latter ?



-- 
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