This is an automated email from the ASF dual-hosted git repository.
viirya pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion-comet.git
The following commit(s) were added to refs/heads/main by this push:
new 71064d2 test: Ensure traversed operators during finding first partial
aggregation are all native (#58)
71064d2 is described below
commit 71064d2b6827282610ca1bce7b470c13b24a71f2
Author: Liang-Chi Hsieh <[email protected]>
AuthorDate: Tue Feb 20 13:19:56 2024 -0800
test: Ensure traversed operators during finding first partial aggregation
are all native (#58)
---
.../apache/comet/exec/CometAggregateSuite.scala | 37 ++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git
a/spark/src/test/scala/org/apache/comet/exec/CometAggregateSuite.scala
b/spark/src/test/scala/org/apache/comet/exec/CometAggregateSuite.scala
index 9098fe2..9b7fb3c 100644
--- a/spark/src/test/scala/org/apache/comet/exec/CometAggregateSuite.scala
+++ b/spark/src/test/scala/org/apache/comet/exec/CometAggregateSuite.scala
@@ -39,6 +39,43 @@ import
org.apache.comet.CometSparkSessionExtensions.isSpark34Plus
*/
class CometAggregateSuite extends CometTestBase with AdaptiveSparkPlanHelper {
+ test("Ensure traversed operators during finding first partial aggregation
are all native") {
+ withTable("lineitem", "part") {
+ withSQLConf(
+ CometConf.COMET_ENABLED.key -> "true",
+ CometConf.COMET_EXEC_SHUFFLE_ENABLED.key -> "true",
+ CometConf.COMET_COLUMNAR_SHUFFLE_ENABLED.key -> "true") {
+
+ sql(
+ "CREATE TABLE lineitem(l_extendedprice DOUBLE, l_quantity DOUBLE,
l_partkey STRING) USING PARQUET")
+ sql("INSERT INTO TABLE lineitem VALUES (1.0, 1.0, '1')")
+
+ sql(
+ "CREATE TABLE part(p_partkey STRING, p_brand STRING, p_container
STRING) USING PARQUET")
+ sql("INSERT INTO TABLE part VALUES ('1', 'Brand#23', 'MED BOX')")
+
+ val df = sql("""select
+ sum(l_extendedprice) / 7.0 as avg_yearly
+ from
+ lineitem,
+ part
+ where
+ p_partkey = l_partkey
+ and p_brand = 'Brand#23'
+ and p_container = 'MED BOX'
+ and l_quantity < (
+ select
+ 0.2 * avg(l_quantity)
+ from
+ lineitem
+ where
+ l_partkey = p_partkey
+ )""")
+ checkAnswer(df, Row(null))
+ }
+ }
+ }
+
test("SUM decimal supports emit.first") {
withSQLConf(
SQLConf.OPTIMIZER_EXCLUDED_RULES.key -> EliminateSorts.ruleName,