File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ object AttributeSet {
43
43
* and also makes doing transformations hard (we always try keep older trees instead of new ones
44
44
* when the transformation was a no-op).
45
45
*/
46
- class AttributeSet protected (val baseSet : Set [AttributeEquals ]) extends Traversable [Attribute ] {
46
+ class AttributeSet private (val baseSet : Set [AttributeEquals ])
47
+ extends Traversable [Attribute ] with Serializable {
47
48
48
49
/** Returns true if the members of this AttributeSet and other are the same. */
49
50
override def equals (other : Any ) = other match {
@@ -98,4 +99,8 @@ class AttributeSet protected (val baseSet: Set[AttributeEquals]) extends Travers
98
99
def intersect (other : AttributeSet ) = new AttributeSet (baseSet.intersect(other.baseSet))
99
100
100
101
override def foreach [U ](f : (Attribute ) => U ): Unit = baseSet.map(_.a).foreach(f)
102
+
103
+ // We must force toSeq to not be strict otherwise we end up with a [[Stream]] that captures all
104
+ // sorts of things in its closure.
105
+ override def toSeq : Seq [Attribute ] = baseSet.map(_.a).toArray.toSeq
101
106
}
You can’t perform that action at this time.
0 commit comments