Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9038#discussion_r41679635
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/utils.scala ---
    @@ -70,7 +70,6 @@ object Utils {
         // Check if we can use TungstenAggregate.
         val usesTungstenAggregate =
           child.sqlContext.conf.unsafeEnabled &&
    -      
aggregateExpressions.forall(_.aggregateFunction.isInstanceOf[DeclarativeAggregate])
 &&
    --- End diff --
    
    Whoops, good catch. I removed this from `planAggregateWithOneDistinct` and 
it led to a failure in `single distinct column set`:
    
    ```
    [info]   == Results ==
    [info]   !== Correct Answer - 4 ==                                          
              == Spark Answer - 4 ==
    [info]   ![100.0,0.3333333333333333,1.0,2,99.33333333333333,10.0,2.0]       
              [100.0,0.3333333333333333,1.0,2,101.0,10.0,2.0]
    [info]   ![110.0,10.0,20.0,null,109.0,11.0,30.0]                            
              [110.0,10.0,20.0,null,120.0,11.0,30.0]
    [info]   
![120.0,23.333333333333332,-3.3333333333333335,1,122.33333333333333,12.0,20.0]  
 [120.0,23.333333333333332,-3.3333333333333335,1,96.66666666666667,12.0,20.0]
    [info]   ![null,null,3.0,3,null,null,null]                                  
              [null,null,3.0,3,103.0,null,null] 
(AggregationQuerySuite.scala:690)
    ```
    
    Based on the failure mode here, I suspect that another one of the buffer 
offsets needs to be reset in response to the sort fallback.


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