Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(executor_v2): migrate executors to run TPCH #727

Merged
merged 21 commits into from
Nov 8, 2022
Merged

Conversation

wangrunji0408
Copy link
Member

@wangrunji0408 wangrunji0408 commented Nov 8, 2022

This PR migrates the following executors to fit the new planner:

  • CreateTable / Drop
  • Insert
  • CopyFrom / CopyTo
  • NestedLoopJoin / HashJoin
  • SimpleAgg / HashAgg
  • Limit
  • Order / TopN

TPCH Q1,3,5,6,10 is able to run. But Q6 will produce a wrong result due to an incorrect decimal cast.

This PR also adds support for showing column names in explain. Here is an example of TPCH Q3:

Projection: [l_orderkey, sum((l_extendedprice * (1 - l_discount))), o_orderdate, o_shippriority] (cost=57537.88)              
  TopN: limit=10, offset=0, orderby=[sum((l_extendedprice * (1 - l_discount))) desc, o_orderdate asc] (cost=57487.88)         
    Aggregate: [sum((l_extendedprice * (1 - l_discount)))], groupby=[l_orderkey, o_orderdate, o_shippriority] (cost=56064.105)
      HashJoin: inner, on=([o_orderkey] = [l_orderkey]) (cost=53584.105)                                                      
        HashJoin: inner, on=([c_custkey] = [o_custkey]) (cost=22651.05)                                                       
          Filter: (c_mktsegment = 'BUILDING') (cost=2700)                                                                     
            Scan: [c_custkey, c_mktsegment] (cost=2000)                                                                       
          Filter: (1995-03-15 > o_orderdate) (cost=7500)                                                                      
            Scan: [o_orderkey, o_custkey, o_orderdate, o_shippriority] (cost=4000)                                            
        Filter: (l_shipdate > 1995-03-15) (cost=7500)                                                                         
          Scan: [l_orderkey, l_extendedprice, l_discount, l_shipdate] (cost=4000)                                             

Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
support arbitrary expression in order keys

Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
@wangrunji0408 wangrunji0408 requested a review from skyzh November 8, 2022 01:42
Copy link
Member

@skyzh skyzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!

pub storage: Arc<S>,
}

impl<S: Storage> DropExecutor<S> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed now I'm inclined not to have DropTableExecutor / CreateTableExecutor like what DuckDB did... create / drop table are pure catalog operations and can be handled after binding.

@wangrunji0408 wangrunji0408 enabled auto-merge (squash) November 8, 2022 03:47
@wangrunji0408 wangrunji0408 merged commit 605e72e into main Nov 8, 2022
@wangrunji0408 wangrunji0408 deleted the wrj/executor_v2 branch November 8, 2022 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants