peter-toth commented on code in PR #55644:
URL: https://github.com/apache/spark/pull/55644#discussion_r3174204807


##########
sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/explain.txt:
##########
@@ -47,87 +47,81 @@ TakeOrderedAndProject (129)
             :        :     :              :- * ColumnarToRow (32)
             :        :     :              :  +- Scan parquet 
spark_catalog.default.catalog_sales (31)
             :        :     :              +- ReusedExchange (33)
-            :        :     +- BroadcastExchange (47)
-            :        :        +- * HashAggregate (46)
-            :        :           +- Exchange (45)
-            :        :              +- * HashAggregate (44)
-            :        :                 +- * Project (43)
-            :        :                    +- * BroadcastHashJoin Inner 
BuildRight (42)
-            :        :                       :- * ColumnarToRow (40)
-            :        :                       :  +- Scan parquet 
spark_catalog.default.catalog_returns (39)
-            :        :                       +- ReusedExchange (41)
-            :        +- * Project (79)
-            :           +- * BroadcastHashJoin LeftOuter BuildRight (78)
-            :              :- * HashAggregate (64)
-            :              :  +- Exchange (63)
-            :              :     +- * HashAggregate (62)
-            :              :        +- * Project (61)
-            :              :           +- * BroadcastHashJoin Inner BuildRight 
(60)
-            :              :              :- * Project (55)
-            :              :              :  +- * BroadcastHashJoin Inner 
BuildRight (54)
-            :              :              :     :- * Filter (52)
-            :              :              :     :  +- * ColumnarToRow (51)
-            :              :              :     :     +- Scan parquet 
spark_catalog.default.web_sales (50)
-            :              :              :     +- ReusedExchange (53)
-            :              :              +- BroadcastExchange (59)
-            :              :                 +- * Filter (58)
-            :              :                    +- * ColumnarToRow (57)
-            :              :                       +- Scan parquet 
spark_catalog.default.web_page (56)
-            :              +- BroadcastExchange (77)
-            :                 +- * HashAggregate (76)
-            :                    +- Exchange (75)
-            :                       +- * HashAggregate (74)
-            :                          +- * Project (73)
-            :                             +- * BroadcastHashJoin Inner 
BuildRight (72)
-            :                                :- * Project (70)
-            :                                :  +- * BroadcastHashJoin Inner 
BuildRight (69)
-            :                                :     :- * Filter (67)
-            :                                :     :  +- * ColumnarToRow (66)
-            :                                :     :     +- Scan parquet 
spark_catalog.default.web_returns (65)
-            :                                :     +- ReusedExchange (68)
-            :                                +- ReusedExchange (71)
-            :- * HashAggregate (103)
-            :  +- Exchange (102)
-            :     +- * HashAggregate (101)
-            :        +- * HashAggregate (100)
-            :           +- * HashAggregate (99)
-            :              +- Union (98)
-            :                 :- * Project (87)
-            :                 :  +- * BroadcastHashJoin LeftOuter BuildRight 
(86)
-            :                 :     :- * HashAggregate (84)
-            :                 :     :  +- ReusedExchange (83)
-            :                 :     +- ReusedExchange (85)
-            :                 :- * Project (92)
-            :                 :  +- * BroadcastNestedLoopJoin Inner BuildRight 
(91)
-            :                 :     :- * HashAggregate (89)
-            :                 :     :  +- ReusedExchange (88)
-            :                 :     +- ReusedExchange (90)
-            :                 +- * Project (97)
-            :                    +- * BroadcastHashJoin LeftOuter BuildRight 
(96)
-            :                       :- * HashAggregate (94)
-            :                       :  +- ReusedExchange (93)
-            :                       +- ReusedExchange (95)
-            +- * HashAggregate (124)
-               +- Exchange (123)
-                  +- * HashAggregate (122)
-                     +- * HashAggregate (121)
-                        +- * HashAggregate (120)
-                           +- Union (119)
-                              :- * Project (108)
-                              :  +- * BroadcastHashJoin LeftOuter BuildRight 
(107)
-                              :     :- * HashAggregate (105)
-                              :     :  +- ReusedExchange (104)
-                              :     +- ReusedExchange (106)
-                              :- * Project (113)
-                              :  +- * BroadcastNestedLoopJoin Inner BuildRight 
(112)
-                              :     :- * HashAggregate (110)
-                              :     :  +- ReusedExchange (109)
-                              :     +- ReusedExchange (111)
-                              +- * Project (118)
-                                 +- * BroadcastHashJoin LeftOuter BuildRight 
(117)
-                                    :- * HashAggregate (115)
-                                    :  +- ReusedExchange (114)
-                                    +- ReusedExchange (116)
+            :        :     +- BroadcastExchange (41)
+            :        :        +- * Project (40)

Review Comment:
   This change in the golden plan that the aggregate calculation is moved to a 
subquery of `Project (40)` is unnecessary and must be related to some kind of 
`PlanMerger` issue.
   Since both plans are semantically correct, let me investigate this plan 
change in a separate ticket and keep this PR as a canonicalization bugfix.



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