Skip to content

Commit

Permalink
tpc-ds-a-thon test98
Browse files Browse the repository at this point in the history
  • Loading branch information
jitingxu1 committed Aug 26, 2024
1 parent 9da3c9f commit 47a5fbc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions ibis/backends/tests/tpc/ds/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -3208,3 +3208,28 @@ def test_63(item, store_sales, date_dim, store):
.order_by(_.i_manager_id, _.avg_monthly_sales, _.sum_sales)
.limit(100)
)



@tpc_test("ds")
def test_98(store_sales, item, date_dim):
return store_sales.join(
item, [("ss_item_sk", "i_item_sk")]
).join(
date_dim, [("ss_sold_date_sk", "d_date_sk")]
).filter(
_.i_category.isin(["Sports", "Books", "Home"]),
_.d_date.between("1999-02-22", "1999-03-24")
).group_by(
_.i_item_id, _.i_item_desc, _.i_category, _.i_class, _.i_current_price
).agg(
itemrevenue=_.ss_ext_sales_price.sum()
).mutate(
revenueratio=_.itemrevenue * 100.0000 / _.itemrevenue.sum().over(group_by=_.i_class)
).order_by(
_.i_category.asc(nulls_first=True),
_.i_class.asc(nulls_first=True),
_.i_item_id.asc(nulls_first=True),
_.i_item_desc.asc(nulls_first=True),
_.revenueratio.asc(nulls_first=True)
)

0 comments on commit 47a5fbc

Please sign in to comment.