parthchandra commented on code in PR #433:
URL: https://github.com/apache/datafusion-comet/pull/433#discussion_r1610819301


##########
spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala:
##########
@@ -1452,17 +1452,55 @@ class CometExpressionSuite extends CometTestBase with 
AdaptiveSparkPlanHelper {
         withTable(table) {
           sql(s"create table $table(col string, a int, b float) using parquet")
           sql(s"""
-             |insert into $table values
-             |('Spark SQL  ', 10, 1.2), (NULL, NULL, NULL), ('', 0, 0.0), 
('苹果手机', NULL, 3.999999)
-             |, ('Spark SQL  ', 10, 1.2), (NULL, NULL, NULL), ('', 0, 0.0), 
('苹果手机', NULL, 3.999999)
-             |""".stripMargin)
-          checkSparkAnswerAndOperator("""
-               |select
-               |md5(col), md5(cast(a as string)), md5(cast(b as string)),
-               |hash(col), hash(col, 1), hash(col, 0), hash(col, a, b), 
hash(b, a, col),
-               |sha2(col, 0), sha2(col, 256), sha2(col, 224), sha2(col, 384), 
sha2(col, 512), sha2(col, 128)
-               |from test
+               |insert into $table values
+               |('Spark SQL  ', 10, 1.2), (NULL, NULL, NULL), ('', 0, 0.0), 
('苹果手机', NULL, 3.999999)
+               |, ('Spark SQL  ', 10, 1.2), (NULL, NULL, NULL), ('', 0, 0.0), 
('苹果手机', NULL, 3.999999)
                |""".stripMargin)
+          checkSparkAnswerAndOperator("""
+              |select
+              |md5(col), md5(cast(a as string)), md5(cast(b as string)),
+              |hash(col), hash(col, 1), hash(col, 0), hash(col, a, b), hash(b, 
a, col),
+              |sha2(col, 0), sha2(col, 256), sha2(col, 224), sha2(col, 384), 
sha2(col, 512), sha2(col, 128)
+              |from test
+              |""".stripMargin)
+        }
+      }
+    }
+  }
+
+  test("hash functions with random input") {
+    val dataGen = DataGenerator.DEFAULT
+    // sufficient number of rows to create dictionary encoded ArrowArray.
+    val randomNumRows = 1000

Review Comment:
   The Parquet file writer will automatically generate a dictionary if the 
cardinality is low (i.e there is a small number of unique values). 



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to