Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Ensure traversed operators during finding first partial aggregaion are all native #58

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down