Skip to content

Commit

Permalink
Push down projections into read parquet
Browse files Browse the repository at this point in the history
  • Loading branch information
JayjeetAtGithub committed Jul 2, 2024
1 parent 35f8349 commit 5e8f25d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions cpp/examples/tpch/q5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ int main() {
std::string dataset_dir = BASE_DATASET_DIR;

// 1. Read out the tables from parquet files
auto customer = read_parquet(dataset_dir + "customer/part-0.parquet");
auto orders = read_parquet(dataset_dir + "orders/part-0.parquet");
auto lineitem = read_parquet(dataset_dir + "lineitem/part-0.parquet");
auto supplier = read_parquet(dataset_dir + "supplier/part-0.parquet");
auto nation = read_parquet(dataset_dir + "nation/part-0.parquet");
auto region = read_parquet(dataset_dir + "region/part-0.parquet");
auto customer = read_parquet(dataset_dir + "customer/part-0.parquet", {"c_custkey", "c_nationkey"});
auto orders = read_parquet(dataset_dir + "orders/part-0.parquet", {"o_custkey", "o_orderkey", "o_orderdate"});
auto lineitem = read_parquet(dataset_dir + "lineitem/part-0.parquet", {"l_orderkey", "l_suppkey", "l_extendedprice", "l_discount"});
auto supplier = read_parquet(dataset_dir + "supplier/part-0.parquet", {"s_suppkey", "s_nationkey"});
auto nation = read_parquet(dataset_dir + "nation/part-0.parquet", {"n_nationkey", "n_regionkey", "n_name"});
auto region = read_parquet(dataset_dir + "region/part-0.parquet", {"r_regionkey", "r_name"});

// 2. Perform the joins
auto join_a = apply_inner_join(
Expand Down
12 changes: 6 additions & 6 deletions cpp/examples/tpch/q9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ int main() {
std::string dataset_dir = BASE_DATASET_DIR;

// 1. Read out the table from parquet files
auto lineitem = read_parquet(dataset_dir + "lineitem/part-0.parquet");
auto nation = read_parquet(dataset_dir + "nation/part-0.parquet");
auto orders = read_parquet(dataset_dir + "orders/part-0.parquet");
auto part = read_parquet(dataset_dir + "part/part-0.parquet");
auto partsupp = read_parquet(dataset_dir + "partsupp/part-0.parquet");
auto supplier = read_parquet(dataset_dir + "supplier/part-0.parquet");
auto lineitem = read_parquet(dataset_dir + "lineitem/part-0.parquet", {"l_suppkey", "l_partkey", "l_orderkey", "l_extendedprice", "l_discount", "l_quantity"});
auto nation = read_parquet(dataset_dir + "nation/part-0.parquet", {"n_nationkey", "n_name"});
auto orders = read_parquet(dataset_dir + "orders/part-0.parquet", {"o_orderkey", "o_orderdate"});
auto part = read_parquet(dataset_dir + "part/part-0.parquet", {"p_partkey", "p_name"});
auto partsupp = read_parquet(dataset_dir + "partsupp/part-0.parquet", {"ps_suppkey", "ps_partkey", "ps_supplycost"});
auto supplier = read_parquet(dataset_dir + "supplier/part-0.parquet", {"s_suppkey", "s_nationkey"});

// 2. Generating the `profit` table
// 2.1 Filter the part table using `p_name like '%green%'`
Expand Down

0 comments on commit 5e8f25d

Please sign in to comment.