Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/19289#discussion_r139890182
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
---
@@ -279,7 +279,13 @@ class Analyzer(
* We need to get all of its subsets for a given GROUPBY expression,
the subsets are
* represented as sequence of expressions.
*/
- def cubeExprs(exprs: Seq[Expression]): Seq[Seq[Expression]] =
exprs.toList match {
+ def cubeExprs(exprs: Seq[Expression]): Seq[Seq[Expression]] = {
+ // `cubeExprs0` is recursive and returns a lazy Stream. Here we call
`toIndexedSeq` to
+ // materialize it and avoid serialization problems later on.
+ cubeExprs0(exprs).toIndexedSeq
+ }
+
+ def cubeExprs0(exprs: Seq[Expression]): Seq[Seq[Expression]] =
exprs.toList match {
case x :: xs =>
val initial = cubeExprs(xs)
--- End diff --
`cubeExprs ` -> `cubeExprs0 `?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]