xzj7019 opened a new pull request, #24912:
URL: https://github.com/apache/doris/pull/24912

   ## Proposed changes
   
   Current multi-window plan generation has problem on the project sequence, 
for example:
   
   ```
   +--LogicalWindow ( windowExpressions=[avg(sum_sales#115) WindowSpec(...) AS 
`avg_monthly_sales`#116, rank() WindowSpec(...) AS `rn`#117], ...)
   ```
   
   and correspond physical plan is:
   
   ```
   +--PhysicalWindow[6572]@16 ( windowFrameGroup=(Funcs=[avg(sum_sales#115) 
WindowSpec(...) AS `avg_monthly_sales`#116], ... )
       +--PhysicalWindow[6568]@29 ( windowFrameGroup=(Funcs=[rank() 
WindowSpec(...) AS `rn`#117], ...] )
   ```
   If the final plan is generated as following:
   
   ```
   MultiCastDataSinks
   STREAM DATA SINK
     EXCHANGE ID: 20
     HASH_PARTITIONED: rn[#208], i_brand[#202], cc_name[#203], i_category[#201]
   ```
   Before we eventually resolve the multi-window issue, we add a projection as 
following and force a mapping but this will not cover all potential problems.
   
   ```
   MultiCastDataSinks
   STREAM DATA SINK
     EXCHANGE ID: 20
     HASH_PARTITIONED: rn[#219], i_brand[#213], cc_name[#214], i_category[#212]
     PROJECTIONS: i_category[#184], i_brand[#185], cc_name[#186], d_year[#187], 
d_moy[#188], sum_sales[#189], avg_monthly_sales[#191], rn[#190]
     PROJECTION TUPLE: 20
   ```
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[[email protected]](mailto:[email protected]) by explaining why you 
chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to