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

    https://github.com/apache/spark/pull/9673#discussion_r44746437
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala ---
    @@ -295,12 +299,12 @@ class Dataset[T] private[sql](
        */
       def groupBy[K : Encoder](func: T => K): GroupedDataset[K, T] = {
         val inputPlan = queryExecution.analyzed
    -    val withGroupingKey = AppendColumn(func, inputPlan)
    +    val withGroupingKey = AppendColumn(func, resolvedTEncoder, inputPlan)
    --- End diff --
    
    My thoughts are that we should follow the same pattern as in expressions 
since we are already have to do eager resolution here inorder to output errors. 
 Logical query plans after the analyzer have resolved encoders, and then let 
the physical query plans do the binding.  The nice thing about passing a 
resolved encoder in is that in some cases the resolution could be ambiguous 
(think when we have both grouping columns and data columns with overlapping 
field names) even though I don't think that is the case here.
    
    That said, we should maybe consider moving this step into the analyzer at 
some point.


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