duongcongtoai commented on issue #5492:
URL: https://github.com/apache/datafusion/issues/5492#issuecomment-2900055370

   From my understanding DelimScan is a `LogicalPlan::Aggregate` wrapped around 
a `LogicalPlan::TableScan`, but maybe @irenjj can provide more information
   
   -----------
   I may be able to work on some of this story by this week: detect all 
dependent join nodes (actually my previous PR will not go to waste and can 
reuse alot of stuff for this)
   
   After this implementation we will have a Logical Plan similar to this of 
duckdb
   ```
   D explain select * from table1 where value > (select count(*) from table2 t2 
where t2.ref_id=table1.id and quantity=(select count(*) from table1 t1 where 
t1.id=table1.id));
   
   ┌─────────────────────────────┐
   │┌───────────────────────────┐│
   ││ Unoptimized Logical Plan  ││
   │└───────────────────────────┘│
   └─────────────────────────────┘
   ┌───────────────────────────┐
   │         PROJECTION        │
   │    ────────────────────   │
   │        Expressions:       │
   │             id            │
   │           value           │
   └─────────────┬─────────────┘
   ┌─────────────┴─────────────┐
   │           FILTER          │
   │    ────────────────────   │
   │        Expressions:       │
   │  (CAST(value AS BIGINT) > │
   │          SUBQUERY)        │
   └─────────────┬─────────────┘
   ┌─────────────┴─────────────┐
   │       DEPENDENT_JOIN      │
   │    ────────────────────   ├──────────────┐
   │     Join Type: SINGLE     │              │
   └─────────────┬─────────────┘              │
   ┌─────────────┴─────────────┐┌─────────────┴─────────────┐
   │          SEQ_SCAN         ││         PROJECTION        │
   │    ────────────────────   ││    ────────────────────   │
   │       Table: table1       ││        Expressions:       │
   │   Type: Sequential Scan   ││        count_star()       │
   └───────────────────────────┘└─────────────┬─────────────┘
                                ┌─────────────┴─────────────┐
                                │         AGGREGATE         │
                                │    ────────────────────   │
                                │        Expressions:       │
                                │        count_star()       │
                                └─────────────┬─────────────┘
                                ┌─────────────┴─────────────┐
                                │           FILTER          │
                                │    ────────────────────   │
                                │        Expressions:       │
                                │       (ref_id = id)       │
                                │ (CAST(quantity AS BIGINT) │
                                │        = SUBQUERY)        │
                                └─────────────┬─────────────┘
                                ┌─────────────┴─────────────┐
                                │       DEPENDENT_JOIN      │
                                │    ────────────────────   ├──────────────┐
                                │     Join Type: SINGLE     │              │
                                └─────────────┬─────────────┘              │
                                
┌─────────────┴─────────────┐┌─────────────┴─────────────┐
                                │          SEQ_SCAN         ││         
PROJECTION        │
                                │    ────────────────────   ││    
────────────────────   │
                                │       Table: table2       ││        
Expressions:       │
                                │   Type: Sequential Scan   ││        
count_star()       │
                                
└───────────────────────────┘└─────────────┬─────────────┘
                                                             
┌─────────────┴─────────────┐
                                                             │         
AGGREGATE         │
                                                             │    
────────────────────   │
                                                             │        
Expressions:       │
                                                             │        
count_star()       │
                                                             
└─────────────┬─────────────┘
                                                             
┌─────────────┴─────────────┐
                                                             │           FILTER 
         │
                                                             │    
────────────────────   │
                                                             │        
Expressions:       │
                                                             │         (id = 
id)         │
                                                             
└─────────────┬─────────────┘
                                                             
┌─────────────┴─────────────┐
                                                             │          
SEQ_SCAN         │
                                                             │    
────────────────────   │
                                                             │       Table: 
table1       │
                                                             │   Type: 
Sequential Scan   │
                                                             
└───────────────────────────┘
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to