Skip to content

Commit 2b3cde2

Browse files
committed
add example plan
1 parent c49a0f9 commit 2b3cde2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,6 +1655,23 @@ class SubquerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark
16551655
|LIMIT 1
16561656
""".stripMargin)
16571657

1658+
// scalastyle:off
1659+
// CollectLimit 1
1660+
// +- *(1) Project [Subquery scalar-subquery#240, [id=#112] AS scalarsubquery()#248, Subquery scalar-subquery#242, [id=#183] AS scalarsubquery()#249]
1661+
// : :- Subquery scalar-subquery#240, [id=#112]
1662+
// : : +- *(2) HashAggregate(keys=[], functions=[avg(cast(key#13 as bigint))])
1663+
// : : +- Exchange SinglePartition, true, [id=#108]
1664+
// : : +- *(1) HashAggregate(keys=[], functions=[partial_avg(cast(key#13 as bigint))])
1665+
// : : +- *(1) SerializeFromObject [knownnotnull(assertnotnull(input[0, org.apache.spark.sql.test.SQLTestData$TestData, true])).key AS key#13]
1666+
// : : +- Scan[obj#12]
1667+
// : +- Subquery scalar-subquery#242, [id=#183]
1668+
// : +- *(1) Project [ReusedSubquery Subquery scalar-subquery#240, [id=#112] AS scalarsubquery()#247]
1669+
// : : +- ReusedSubquery Subquery scalar-subquery#240, [id=#112]
1670+
// : +- *(1) Scan OneRowRelation[]
1671+
// +- *(1) SerializeFromObject
1672+
// +- Scan[obj#12]
1673+
// scalastyle:on
1674+
16581675
val plan = df.queryExecution.executedPlan
16591676

16601677
val subqueryIds = plan.collectWithSubqueries { case s: SubqueryExec => s.id }

0 commit comments

Comments
 (0)