Skip to content

Commit

Permalink
tpcds plan changes after applying changes from CALCITE-6737
Browse files Browse the repository at this point in the history
  • Loading branch information
soumyakanti3578 committed Dec 19, 2024
1 parent edcb646 commit 6678b84
Show file tree
Hide file tree
Showing 17 changed files with 1,618 additions and 1,378 deletions.
Original file line number Diff line number Diff line change
@@ -1,77 +1,93 @@
CTE Suggestion:
HiveProject(d_date_sk=[$0])
HiveFilter(condition=[=($6, 1999)])
HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
HiveFilter(condition=[=($1, 1999)])
HiveProject(d_date_sk=[$0], d_year=[$6])
HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])

CTE Suggestion:
HiveProject(d_date_sk=[$0])
HiveFilter(condition=[=($6, 2000)])
HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
HiveFilter(condition=[=($1, 2000)])
HiveProject(d_date_sk=[$0], d_year=[$6])
HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])

CTE Suggestion:
HiveProject(ss_customer_sk=[$2], ss_sold_date_sk=[$22], $f8=[-($16, $13)])
HiveFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($22))])
HiveTableScan(table=[[default, store_sales]], table:alias=[store_sales])
HiveProject(ss_customer_sk=[$0], ss_sold_date_sk=[$3], $f8=[-($2, $1)])
HiveFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($3))])
HiveProject(ss_customer_sk=[$2], ss_ext_discount_amt=[$13], ss_ext_list_price=[$16], ss_sold_date_sk=[$22])
HiveTableScan(table=[[default, store_sales]], table:alias=[store_sales])

CTE Suggestion:
HiveProject(ws_bill_customer_sk=[$3], ws_sold_date_sk=[$33], $f8=[-($24, $21)])
HiveFilter(condition=[AND(IS NOT NULL($3), IS NOT NULL($33))])
HiveTableScan(table=[[default, web_sales]], table:alias=[web_sales])
HiveProject(ws_bill_customer_sk=[$0], ws_sold_date_sk=[$3], $f8=[-($2, $1)])
HiveFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($3))])
HiveProject(ws_bill_customer_sk=[$3], ws_ext_discount_amt=[$21], ws_ext_list_price=[$24], ws_sold_date_sk=[$33])
HiveTableScan(table=[[default, web_sales]], table:alias=[web_sales])

CBO PLAN:
HiveSortLimit(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$3], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], fetch=[100])
HiveProject(customer_id=[$8], customer_first_name=[$9], customer_last_name=[$10], customer_birth_country=[$11])
HiveJoin(condition=[AND(=($8, $2), CASE($4, CASE($7, >(/($1, $6), /($12, $3)), >(0:DECIMAL(1, 0), /($12, $3))), CASE($7, >(/($1, $6), 0:DECIMAL(1, 0)), false)))], joinType=[inner], algorithm=[none], cost=[not available])
HiveJoin(condition=[=($2, $0)], joinType=[inner], algorithm=[none], cost=[not available])
HiveProject(c_customer_id=[$0], $f1=[$1])
HiveAggregate(group=[{5}], agg#0=[sum($2)])
HiveJoin(condition=[=($4, $0)], joinType=[inner], algorithm=[none], cost=[not available])
HiveJoin(condition=[=($1, $3)], joinType=[inner], algorithm=[none], cost=[not available])
HiveProject(ws_bill_customer_sk=[$3], ws_sold_date_sk=[$33], $f8=[-($24, $21)])
HiveFilter(condition=[AND(IS NOT NULL($3), IS NOT NULL($33))])
HiveTableScan(table=[[default, web_sales]], table:alias=[web_sales])
HiveProject(d_date_sk=[$0])
HiveFilter(condition=[=($6, 2000)])
HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
HiveProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9], c_preferred_cust_flag=[$10], c_birth_country=[$14], c_login=[$15], c_email_address=[$16])
HiveTableScan(table=[[default, customer]], table:alias=[customer])
HiveJoin(condition=[=($0, $3)], joinType=[inner], algorithm=[none], cost=[not available])
HiveProject(customer_id=[$0], year_total=[$1], EXPR$0=[>($1, 0:DECIMAL(1, 0))])
HiveFilter(condition=[>($1, 0:DECIMAL(1, 0))])
HiveProject(customer_id=[$0], customer_first_name=[$2], customer_last_name=[$3], customer_birth_country=[$4])
HiveJoin(condition=[=($0, $1)], joinType=[inner], algorithm=[none], cost=[not available])
HiveProject(customer_id=[$0])
HiveJoin(condition=[AND(CASE($5, CASE($10, >(/($7, $9), /($2, $4)), >(0:DECIMAL(1, 0), /($2, $4))), CASE($10, >(/($7, $9), 0:DECIMAL(1, 0)), false)), =($0, $8))], joinType=[inner], algorithm=[none], cost=[not available])
HiveJoin(condition=[=($0, $6)], joinType=[inner], algorithm=[none], cost=[not available])
HiveJoin(condition=[=($0, $3)], joinType=[inner], algorithm=[none], cost=[not available])
HiveProject(c_customer_id=[$0], c_birth_country=[$1], $f2=[$2])
HiveAggregate(group=[{5, 8}], agg#0=[sum($2)])
HiveJoin(condition=[=($4, $0)], joinType=[inner], algorithm=[none], cost=[not available])
HiveJoin(condition=[=($1, $3)], joinType=[inner], algorithm=[none], cost=[not available])
HiveProject(ss_customer_sk=[$0], ss_sold_date_sk=[$3], $f8=[-($2, $1)])
HiveFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($3))])
HiveProject(ss_customer_sk=[$2], ss_ext_discount_amt=[$13], ss_ext_list_price=[$16], ss_sold_date_sk=[$22])
HiveTableScan(table=[[default, store_sales]], table:alias=[store_sales])
HiveProject(d_date_sk=[$0])
HiveFilter(condition=[=($1, 2000)])
HiveProject(d_date_sk=[$0], d_year=[$6])
HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
HiveProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9], c_birth_country=[$14])
HiveTableScan(table=[[default, customer]], table:alias=[customer])
HiveProject(customer_id=[$0], year_total=[$1], EXPR$0=[>($1, 0:DECIMAL(1, 0))])
HiveFilter(condition=[>($1, 0:DECIMAL(1, 0))])
HiveAggregate(group=[{5}], agg#0=[sum($2)])
HiveJoin(condition=[=($4, $0)], joinType=[inner], algorithm=[none], cost=[not available])
HiveJoin(condition=[=($1, $3)], joinType=[inner], algorithm=[none], cost=[not available])
HiveProject(ss_customer_sk=[$0], ss_sold_date_sk=[$3], $f8=[-($2, $1)])
HiveFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($3))])
HiveProject(ss_customer_sk=[$2], ss_ext_discount_amt=[$13], ss_ext_list_price=[$16], ss_sold_date_sk=[$22])
HiveTableScan(table=[[default, store_sales]], table:alias=[store_sales])
HiveProject(d_date_sk=[$0])
HiveFilter(condition=[=($1, 1999)])
HiveProject(d_date_sk=[$0], d_year=[$6])
HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
HiveProject(c_customer_sk=[$0], c_customer_id=[$1])
HiveTableScan(table=[[default, customer]], table:alias=[customer])
HiveProject(c_customer_id=[$0], $f1=[$1])
HiveAggregate(group=[{5}], agg#0=[sum($2)])
HiveJoin(condition=[=($4, $0)], joinType=[inner], algorithm=[none], cost=[not available])
HiveJoin(condition=[=($1, $3)], joinType=[inner], algorithm=[none], cost=[not available])
HiveProject(ss_customer_sk=[$2], ss_sold_date_sk=[$22], $f8=[-($16, $13)])
HiveFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($22))])
HiveTableScan(table=[[default, store_sales]], table:alias=[store_sales])
HiveProject(ws_bill_customer_sk=[$0], ws_sold_date_sk=[$3], $f8=[-($2, $1)])
HiveFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($3))])
HiveProject(ws_bill_customer_sk=[$3], ws_ext_discount_amt=[$21], ws_ext_list_price=[$24], ws_sold_date_sk=[$33])
HiveTableScan(table=[[default, web_sales]], table:alias=[web_sales])
HiveProject(d_date_sk=[$0])
HiveFilter(condition=[=($6, 1999)])
HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
HiveProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9], c_preferred_cust_flag=[$10], c_birth_country=[$14], c_login=[$15], c_email_address=[$16])
HiveFilter(condition=[=($1, 2000)])
HiveProject(d_date_sk=[$0], d_year=[$6])
HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
HiveProject(c_customer_sk=[$0], c_customer_id=[$1])
HiveTableScan(table=[[default, customer]], table:alias=[customer])
HiveProject(customer_id=[$0], year_total=[$1], EXPR$1=[>($1, 0:DECIMAL(1, 0))])
HiveFilter(condition=[>($1, 0:DECIMAL(1, 0))])
HiveAggregate(group=[{5}], agg#0=[sum($2)])
HiveJoin(condition=[=($4, $0)], joinType=[inner], algorithm=[none], cost=[not available])
HiveJoin(condition=[=($1, $3)], joinType=[inner], algorithm=[none], cost=[not available])
HiveProject(ws_bill_customer_sk=[$3], ws_sold_date_sk=[$33], $f8=[-($24, $21)])
HiveFilter(condition=[AND(IS NOT NULL($3), IS NOT NULL($33))])
HiveTableScan(table=[[default, web_sales]], table:alias=[web_sales])
HiveProject(ws_bill_customer_sk=[$0], ws_sold_date_sk=[$3], $f8=[-($2, $1)])
HiveFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($3))])
HiveProject(ws_bill_customer_sk=[$3], ws_ext_discount_amt=[$21], ws_ext_list_price=[$24], ws_sold_date_sk=[$33])
HiveTableScan(table=[[default, web_sales]], table:alias=[web_sales])
HiveProject(d_date_sk=[$0])
HiveFilter(condition=[=($6, 1999)])
HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
HiveProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9], c_preferred_cust_flag=[$10], c_birth_country=[$14], c_login=[$15], c_email_address=[$16])
HiveFilter(condition=[=($1, 1999)])
HiveProject(d_date_sk=[$0], d_year=[$6])
HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
HiveProject(c_customer_sk=[$0], c_customer_id=[$1])
HiveTableScan(table=[[default, customer]], table:alias=[customer])
HiveProject(c_customer_id=[$0], c_first_name=[$1], c_last_name=[$2], c_birth_country=[$3], $f4=[$4])
HiveAggregate(group=[{5, 6, 7, 9}], agg#0=[sum($2)])
HiveJoin(condition=[=($4, $0)], joinType=[inner], algorithm=[none], cost=[not available])
HiveJoin(condition=[=($1, $3)], joinType=[inner], algorithm=[none], cost=[not available])
HiveProject(ss_customer_sk=[$2], ss_sold_date_sk=[$22], $f8=[-($16, $13)])
HiveFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($22))])
HiveTableScan(table=[[default, store_sales]], table:alias=[store_sales])
HiveProject(d_date_sk=[$0])
HiveFilter(condition=[=($6, 2000)])
HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
HiveProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9], c_preferred_cust_flag=[$10], c_birth_country=[$14], c_login=[$15], c_email_address=[$16])
HiveTableScan(table=[[default, customer]], table:alias=[customer])
HiveProject(c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9], c_birth_country=[$14])
HiveTableScan(table=[[default, customer]], table:alias=[customer])

Loading

0 comments on commit 6678b84

Please sign in to comment.