Skip to content

Commit

Permalink
fix compare date to str in trino
Browse files Browse the repository at this point in the history
  • Loading branch information
jitingxu1 committed Aug 26, 2024
1 parent e06e9b5 commit a783bac
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions ibis/backends/tests/tpc/ds/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -3212,23 +3212,27 @@ def test_63(item, store_sales, date_dim, store):

@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(
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(
_.d_date.cast("str").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(
)
.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)
_.revenueratio.asc(nulls_first=True),
)
)

0 comments on commit a783bac

Please sign in to comment.