diff --git a/tpch/queries/q16.py b/tpch/queries/q16.py index d3341d3fe..781341be0 100644 --- a/tpch/queries/q16.py +++ b/tpch/queries/q16.py @@ -11,7 +11,6 @@ def query(part_ds: FrameT, partsupp_ds: FrameT, supplier_ds: FrameT) -> FrameT: ).select(nw.col("s_suppkey"), nw.col("s_suppkey").alias("ps_suppkey")) return ( - # not Done part_ds.join(partsupp_ds, left_on="p_partkey", right_on="ps_partkey") .filter(nw.col("p_brand") != var1) .filter(~nw.col("p_type").str.contains("MEDIUM POLISHED*")) @@ -19,7 +18,7 @@ def query(part_ds: FrameT, partsupp_ds: FrameT, supplier_ds: FrameT) -> FrameT: .join(supplier, left_on="ps_suppkey", right_on="s_suppkey", how="left") .filter(nw.col("ps_suppkey_right").is_null()) .group_by("p_brand", "p_type", "p_size") - .agg(nw.col("ps_suppkey").n_unique().alias("supplier_cnt")) + .agg(nw.col("ps_suppkey").unique().len().alias("supplier_cnt")) .sort( by=["supplier_cnt", "p_brand", "p_type", "p_size"], descending=[True, False, False, False],