LuciferYang opened a new pull request, #45811:
URL: https://github.com/apache/spark/pull/45811

   ### What changes were proposed in this pull request?
   When I reviewed the changes in SPARK-45685, I found an old user case that is 
no longer supported:
   
   ```scala
   Seq(1).toDF("id").groupBy(Stream($"id" + 1, $"id" + 2): _*).sum("id")
   ```
   
   ```
   [info] - SPARK-38221: group by `Stream` of complex expressions should not 
fail *** FAILED *** (51 milliseconds)
   [info]   org.apache.spark.SparkException: Task not serializable
   [info]   at 
org.apache.spark.util.SparkClosureCleaner$.clean(SparkClosureCleaner.scala:45)
   [info]   at org.apache.spark.SparkContext.clean(SparkContext.scala:2718)
   [info]   at 
org.apache.spark.rdd.RDD.$anonfun$mapPartitionsWithIndex$1(RDD.scala:908)
   [info]   at 
org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
   [info]   at 
org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:112)
   [info]   at org.apache.spark.rdd.RDD.withScope(RDD.scala:411)
   [info]   at org.apache.spark.rdd.RDD.mapPartitionsWithIndex(RDD.scala:907)
   [info]   at 
org.apache.spark.sql.execution.WholeStageCodegenExec.doExecute(WholeStageCodegenExec.scala:762)
   ...
   ```
   
   Since this is a historical user usage, and although the `Stream` type has 
been deprecated after Scala 2.13.0, it has not been removed, so this PR 
restores the support for `Stream` type in `Dataset#groupBy`.
   
   
   ### Why are the changes needed?
   Restore the support for `Stream` type in `Dataset#groupBy`
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   - Pass GitHub Actions
   - Restored the test case for dataset group by `Stream`.
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No
   


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