From b5ef806deb7b2281d4127d8d779e0a7bf176b0e8 Mon Sep 17 00:00:00 2001 From: Ruifeng Zheng Date: Mon, 7 Oct 2024 10:44:54 +0800 Subject: [PATCH] Revert "[SPARK-49808][SQL] Fix a deadlock in subquery execution due to lazy vals" This reverts commit d7abddc454ffef6ac16e8f6df6f601eec621ddfd. --- .../org/apache/spark/sql/catalyst/plans/QueryPlan.scala | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala index ca5ff78b10e91..3f417644082c3 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala @@ -32,7 +32,6 @@ import org.apache.spark.sql.catalyst.trees.TreePatternBits import org.apache.spark.sql.catalyst.types.DataTypeUtils import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.types.{DataType, StructType} -import org.apache.spark.util.LazyTry import org.apache.spark.util.collection.BitSet /** @@ -95,11 +94,9 @@ abstract class QueryPlan[PlanType <: QueryPlan[PlanType]] * All Attributes that appear in expressions from this operator. Note that this set does not * include attributes that are implicitly referenced by being passed through to the output tuple. */ - def references: AttributeSet = lazyReferences.get - @transient - private val lazyReferences = LazyTry { - AttributeSet(expressions) -- producedAttributes + lazy val references: AttributeSet = { + AttributeSet.fromAttributeSets(expressions.map(_.references)) -- producedAttributes } /**