ic4y commented on issue #1312:
URL: 
https://github.com/apache/arrow-datafusion/issues/1312#issuecomment-969963124


   @houqp 
   Like the following, I added group by for distinct Aggregate, and then 
deleted distinct in count. At this time, aggr_expr has changed, but I don’t 
want to rewrite the schema, because subsequent Plan Nodes will use this schema 
like ProjectionNode
   
   
   ```
   Projection: #COUNT(DISTINCT lineorder_flat.lo_orderkey) AS a [a:UInt64;N]
     Aggregate: groupBy=[[]], aggr=[[COUNT(DISTINCT 
#lineorder_flat.lo_orderkey)]] [COUNT(DISTINCT 
lineorder_flat.lo_orderkey):UInt64;N]
       TableScan: lineorder_flat projection=Some([0]) [lo_orderkey:Int64;N]
   
   -------------------custom optimizer------------------------------------------
   Projection: #COUNT(DISTINCT lineorder_flat.lo_orderkey) AS a [a:UInt64;N]
     Aggregate: groupBy=[[]], aggr=[[COUNT(#lineorder_flat.lo_orderkey)]] 
[COUNT(DISTINCT lineorder_flat.lo_orderkey):UInt64;N]
       Aggregate: groupBy=[[#lineorder_flat.lo_orderkey]], aggr=[[]] 
[lo_orderkey:Int64;N]
         TableScan: lineorder_flat projection=Some([0]) [lo_orderkey:Int64;N]
   ```
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to