From 7765dac85b01130151512455e2bcf46be04017d8 Mon Sep 17 00:00:00 2001 From: Ritchie Vink Date: Tue, 11 Jun 2024 15:19:03 +0200 Subject: [PATCH] q9 closer to SQL (see: coiled) (#130) --- queries/polars/q9.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/queries/polars/q9.py b/queries/polars/q9.py index 5b76989..718fa75 100644 --- a/queries/polars/q9.py +++ b/queries/polars/q9.py @@ -14,13 +14,13 @@ def q() -> None: supplier = utils.get_supplier_ds() q_final = ( - lineitem.join(supplier, left_on="l_suppkey", right_on="s_suppkey") + part.join(partsupp, left_on="p_partkey", right_on="ps_partkey") + .join(supplier, left_on="ps_suppkey", right_on="s_suppkey") .join( - partsupp, - left_on=["l_suppkey", "l_partkey"], - right_on=["ps_suppkey", "ps_partkey"], + lineitem, + left_on=["p_partkey", "ps_suppkey"], + right_on=["l_partkey", "l_suppkey"], ) - .join(part, left_on="l_partkey", right_on="p_partkey") .join(orders, left_on="l_orderkey", right_on="o_orderkey") .join(nation, left_on="s_nationkey", right_on="n_nationkey") .filter(pl.col("p_name").str.contains("green"))