Github user gatorsmile commented on the pull request:

    https://github.com/apache/spark/pull/11427#issuecomment-200524375
  
    Let me post an example here:
    ```SQL
    SELECT sum(b) FROM parquet_t2 group by a, b
    ```
    The current optimized plan is like
    ```
    Aggregate [a#43L,b#44L], [(sum(b#44L),mode=Complete,isDistinct=false) AS 
sum(b)#51L]
    +- Project [a#43L,b#44L]
       +- Relation[a#43L,b#44L,c#45L,d#46L] ParquetFormat part: struct<>, data: 
struct<a:bigint,b:bigint,c:bigint,d:bigint>
    ```
    
    Ideally, we can directly remove the Project.
    ```
    Aggregate [a#43L,b#44L], [(sum(b#44L),mode=Complete,isDistinct=false) AS 
sum(b)#51L]
     +- Relation[a#43L,b#44L,c#45L,d#46L] ParquetFormat part: struct<>, data: 
struct<a:bigint,b:bigint,c:bigint,d:bigint>
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to