Skip to content
Closed
Changes from 4 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
dad709c
Support LeafRunnableCommand as sub query
beliefer May 12, 2021
0338a23
Support LeafRunnableCommand as sub query
beliefer May 12, 2021
40cea6b
Support LeafRunnableCommand as sub query
beliefer May 12, 2021
a82ed76
Unify the behavior eagerly execute the commands
beliefer May 14, 2021
bf296fb
Update code
beliefer May 17, 2021
babe0d0
Merge branch 'master' into SPARK-35378
beliefer May 17, 2021
803a12a
Update code
beliefer May 17, 2021
4c9b3cf
Merge branch 'SPARK-35378' of github.com:beliefer/spark into SPARK-35378
beliefer May 17, 2021
e3b8454
Update code
beliefer May 17, 2021
6516cc4
Update code
beliefer May 17, 2021
ddbb5bb
Optimize code
beliefer May 18, 2021
bde1062
Optimize code
beliefer May 18, 2021
7a7bc55
Update code
beliefer May 18, 2021
2ad5391
Update code
beliefer May 19, 2021
33f0297
Optimize code
beliefer May 19, 2021
309fb0f
Update code
beliefer May 20, 2021
8e9277d
Update code
beliefer May 20, 2021
d006b2a
Update code
beliefer May 20, 2021
fc3afe3
Update code
beliefer May 20, 2021
fde3c31
Update code
beliefer May 21, 2021
b58c0ea
Update code
beliefer May 21, 2021
4dcc759
Update code
beliefer May 21, 2021
f47dda6
Update code
beliefer May 22, 2021
2a61f23
Update code
beliefer May 25, 2021
cd7d39c
Update code
beliefer May 25, 2021
6c74474
Merge branch 'master' into SPARK-35378
beliefer May 25, 2021
26c2341
Update code
beliefer May 25, 2021
d11b00d
Update code
beliefer May 26, 2021
a61c267
Update code
beliefer May 26, 2021
8fe6c06
Update code
beliefer May 26, 2021
b20b000
Update code
beliefer May 26, 2021
b60e04e
Update code
beliefer May 26, 2021
94ba930
Update code
beliefer May 26, 2021
0ed9485
Update code
beliefer May 26, 2021
911e081
Update code
beliefer May 26, 2021
ecfe9ba
update code
beliefer May 26, 2021
cfeadd1
Update code
beliefer May 27, 2021
6a80674
Update code
beliefer May 29, 2021
c81b082
Update code
beliefer May 29, 2021
ee1e84a
Update code
beliefer May 29, 2021
9c95570
Update code
beliefer May 31, 2021
219abb4
Merge branch 'SPARK-35378' of github.com:beliefer/spark into SPARK-35378
beliefer May 31, 2021
f39f920
Update code
beliefer May 31, 2021
1d10b61
Update code
beliefer May 31, 2021
2bcdddd
Update code
beliefer May 31, 2021
5d9f7ee
Update code
beliefer Jun 1, 2021
6011bbe
Update code
beliefer Jun 2, 2021
0905d84
Update code
beliefer Jun 2, 2021
3f6cb85
Update code
beliefer Jun 2, 2021
1d821e0
Update code
beliefer Jun 4, 2021
ddbc5c4
Update code
beliefer Jun 4, 2021
d545d9b
Update code
beliefer Jun 4, 2021
4b730d4
Update code
beliefer Jun 4, 2021
de55034
Update code
beliefer Jun 4, 2021
1a3ce51
Update code
beliefer Jun 5, 2021
ccf8ba3
Update code
beliefer Jun 7, 2021
35ea747
Merge branch 'master' into SPARK-35378
beliefer Jun 7, 2021
2b2caf7
Update code
beliefer Jun 7, 2021
1db52b9
Update code
beliefer Jun 7, 2021
83d2710
Update QueryExecution.scala
cloud-fan Jun 8, 2021
8054799
Update code
beliefer Jun 8, 2021
d15e166
Update code
beliefer Jun 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ import org.apache.spark.sql.catalyst.analysis.UnsupportedOperationChecker
import org.apache.spark.sql.catalyst.expressions.SubqueryExpression
import org.apache.spark.sql.catalyst.expressions.codegen.ByteCodeStats
import org.apache.spark.sql.catalyst.plans.QueryPlan
import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, ReturnAnswer}
import org.apache.spark.sql.catalyst.plans.logical.{Command, LocalRelation, LogicalPlan, ReturnAnswer}
import org.apache.spark.sql.catalyst.rules.{PlanChangeLogger, Rule}
import org.apache.spark.sql.catalyst.util.StringUtils.PlanStringConcat
import org.apache.spark.sql.catalyst.util.truncatedString
import org.apache.spark.sql.execution.adaptive.{AdaptiveExecutionContext, InsertAdaptiveSparkPlan}
import org.apache.spark.sql.execution.bucketing.{CoalesceBucketsInJoin, DisableUnnecessaryBucketedScan}
import org.apache.spark.sql.execution.command.{ExecutedCommandExec, LeafRunnableCommand}
import org.apache.spark.sql.execution.dynamicpruning.PlanDynamicPruningFilters
import org.apache.spark.sql.execution.exchange.{EnsureRequirements, ReuseExchange}
import org.apache.spark.sql.execution.streaming.{IncrementalExecution, OffsetSeqMetadata}
Expand Down Expand Up @@ -71,7 +72,12 @@ class QueryExecution(

lazy val analyzed: LogicalPlan = executePhase(QueryPlanningTracker.ANALYSIS) {
// We can't clone `logical` here, which will reset the `_analyzed` flag.
sparkSession.sessionState.analyzer.executeAndCheck(logical, tracker)
sparkSession.sessionState.analyzer.executeAndCheck(logical, tracker) transform {
// SPARK-35378: Eagerly execute LeafRunnableCommand so that query command with CTE
case r: LeafRunnableCommand =>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should run all Commands, not just LeafRunnableCommand

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

LocalRelation(r.output, ExecutedCommandExec(r).executeCollect())
case other => other
}
}

lazy val withCachedData: LogicalPlan = sparkSession.withActive {
Expand Down