yjhjstz opened a new issue, #1753:
URL: https://github.com/apache/cloudberry/issues/1753

   ### Apache Cloudberry version
   
     
    main branch
   
   ### What happened
   
    When ORCA translates a `GROUP BY ROLLUP(...)` / `CUBE(...)` / `GROUPING 
SETS ()` query, columns can be **silently NULL-ed out in the wrong grouping 
levels**, producing incorrect query
     results — no error, no crash, just wrong output.
   
    
     
   
   ### What you think should happen instead
   
   ## Reproduction
   
     ```sql
     -- Apache Cloudberry / GPDB, ORCA enabled (default)
     SET optimizer = on;
   
     SELECT generate_series(1, a) g, a+b ab
       FROM (VALUES (1,1),(2,2)) t(a,b)
       GROUP BY ROLLUP(a, ab)
       ORDER BY 1, 2;
   
     Actual (buggy) result with ORCA
   
      g | ab
     ---+----
     (0 rows)
   
   Expected result (matches PostgreSQL planner, SET optimizer = off)
   
      g | ab
     ---+----
      1 |  2
      1 |  4
      1 |
      1 |
      2 |  4
      2 |
     (6 rows)
   
   ### How to reproduce
   
   RT
   
   ### Operating System
   
   centos9
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] Yes, I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/cloudberry/blob/main/CODE_OF_CONDUCT.md).
   


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