comphead commented on code in PR #197:
URL:
https://github.com/apache/arrow-datafusion-comet/pull/197#discussion_r1523492371
##########
spark/src/test/scala/org/apache/comet/exec/CometAggregateSuite.scala:
##########
@@ -947,6 +947,40 @@ class CometAggregateSuite extends CometTestBase with
AdaptiveSparkPlanHelper {
}
}
+ test("bitwise aggregate") {
+ withSQLConf(
+ CometConf.COMET_EXEC_SHUFFLE_ENABLED.key -> "true",
+ CometConf.COMET_COLUMNAR_SHUFFLE_ENABLED.key -> "true") {
+ Seq(true, false).foreach { dictionary =>
+ withSQLConf("parquet.enable.dictionary" -> dictionary.toString) {
+ val table = "test"
+ withTable(table) {
+ sql(s"create table $table(col1 int, col2 int, col3 int) using
parquet")
+ sql(
+ s"insert into $table values(4, 1, 1), (4, 1, 1), (3, 3, 1)," +
+ " (2, 4, 2), (1, 3, 2), (null, 1, 1)")
+ val expectedNumOfCometAggregates = 2
+ checkSparkAnswerAndNumOfAggregates(
+ "SELECT BIT_AND(col1), BIT_OR(col1), BIT_XOR(col1) FROM test",
+ expectedNumOfCometAggregates)
+
+ checkSparkAnswerAndNumOfAggregates(
+ "SELECT BIT_AND(col1), BIT_OR(col1), BIT_XOR(col1), MIN(col1),
COUNT(col1) FROM test",
+ expectedNumOfCometAggregates)
+
+ checkSparkAnswerAndNumOfAggregates(
+ "SELECT BIT_AND(col1), BIT_OR(col1), BIT_XOR(col1), col3 FROM
test GROUP BY col3",
+ expectedNumOfCometAggregates)
+
+ checkSparkAnswerAndNumOfAggregates(
Review Comment:
I would add the comments why this test is needed, it looks like the same as
one before that, just MIN/COUNT added
--
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]