Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
7d77bba
SPARK-45959.
Nov 16, 2023
4b0c91a
SPARK-45959.
Nov 16, 2023
b3c529c
SPARK-45959.
Nov 17, 2023
948f4ca
SPARK-45959.
Nov 17, 2023
c5c7b99
SPARK-45959.
Nov 17, 2023
42816b7
SPARK-45959.
Nov 17, 2023
7f2945a
SPARK-45959.
Nov 18, 2023
c46860e
Merge branch 'apache:master' into SPARK-45959
ahshahid Nov 18, 2023
10e338a
Merge branch 'master' into SPARK-45959
Nov 18, 2023
12bec60
Merge branch 'SPARK-45959' of https://github.com/ahshahid/spark into …
Nov 18, 2023
027e0b2
SPARK-45959.
Nov 18, 2023
fa2cb58
Merge branch 'apache:master' into SPARK-45959
ahshahid Nov 18, 2023
2072de4
Merge branch 'SPARK-45959' of https://github.com/ahshahid/spark into …
Nov 18, 2023
0ecbc30
SPARK-45959.
Nov 19, 2023
09296c4
SPARK-45959.
Nov 19, 2023
a6054dc
SPARK-45959.
Nov 19, 2023
bab2518
SPARK-45959.
Nov 19, 2023
d0267d5
SPARK-45959.
Nov 19, 2023
6d035ee
SPARK-45959.
Nov 19, 2023
38a1d44
SPARK-45959.
Nov 19, 2023
0e5d627
SPARK-45959.
Nov 19, 2023
b8575dc
SPARK-45959.
Nov 20, 2023
c11496b
SPARK-45959.
Nov 20, 2023
0abf34a
SPARK-45959.
Nov 20, 2023
ebb2738
SPARK-45959.
Nov 20, 2023
bf1412e
Merge branch 'master' into SPARK-45959
Nov 20, 2023
a5de567
SPARK-45959.
Nov 20, 2023
e05aadd
Merge branch 'master' into SPARK-45959
Nov 20, 2023
f04b05d
Merge branch 'master' into SPARK-45959
Nov 21, 2023
13ac3ae
Merge branch 'master' into SPARK-45959
Nov 21, 2023
d77a022
Merge branch 'master' into SPARK-45959
Nov 21, 2023
bfd28f8
SPARK-45959
Nov 21, 2023
e67761b
SPARK-45959
Nov 22, 2023
00df813
SPARK-45959
Nov 22, 2023
784ce49
SPARK-45959
Nov 22, 2023
b0e6c89
SPARK-45959
Nov 23, 2023
cea6b3c
Merge branch 'master' into SPARK-45959
Nov 23, 2023
e1899c0
SPARK-45959
Nov 23, 2023
edb3443
SPARK-45959
Nov 23, 2023
7716ee9
SPARK-45959
Nov 24, 2023
10a76ba
SPARK-45959
Nov 24, 2023
c95b35b
SPARK-45959
Nov 24, 2023
e8b74f0
SPARK-45959
Nov 24, 2023
0561293
SPARK-45959
Nov 25, 2023
3861873
SPARK-45959
Nov 25, 2023
02b5719
SPARK-45959
Nov 25, 2023
e613eac
SPARK-45959
Nov 25, 2023
f3eb88b
SPARK-45959
Nov 26, 2023
462b08d
SPARK-45959
Nov 26, 2023
8f74078
SPARK-45959
Nov 26, 2023
df4e6b4
SPARK-45959
Nov 27, 2023
3701a8b
SPARK-45959
Nov 27, 2023
d198447
SPARK-45959
Nov 27, 2023
249075d
SPARK-45959
Nov 27, 2023
77ab011
SPARK-45959
Nov 27, 2023
c613a18
SPARK-45959
Nov 27, 2023
ece22a3
Merge branch 'master' into SPARK-45959
Nov 27, 2023
8e80db2
SPARK-45959
Nov 27, 2023
bb4f914
SPARK-45959
Nov 28, 2023
d06129f
SPARK-45959
Nov 28, 2023
80761e8
SPARK-45959
Nov 28, 2023
00e38c4
SPARK-45959
Nov 28, 2023
dd0d168
SPARK-45959
Nov 28, 2023
59bddeb
SPARK-45959
Nov 29, 2023
93e638a
Merge branch 'master' into SPARK-45959
Nov 29, 2023
94155f6
SPARK-45959
Nov 29, 2023
a5e3f09
SPARK-45959
Nov 29, 2023
89433d9
SPARK-45959. Removing some checks and limitation
Dec 11, 2023
f467c5b
SPARK-45959. merged master
Dec 11, 2023
567cf2c
SPARK-45959. formatting failure fix
Dec 11, 2023
ad3e950
SPARK-45959. fix test failure
Dec 11, 2023
e57faff
SPARK-45959. fix test failure
Dec 12, 2023
2fb39ec
SPARK-45959. fix test failure
Dec 12, 2023
c171e0c
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 12, 2023
431e8c6
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 12, 2023
4096d77
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 13, 2023
e2fb0cf
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 13, 2023
89f136e
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 13, 2023
695f0e9
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 13, 2023
0f360f8
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 13, 2023
7954472
Merge branch 'master' into SPARK-45959
Dec 13, 2023
240e9a3
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 13, 2023
ce26612
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 13, 2023
29525fd
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 14, 2023
bc5df23
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 14, 2023
2d2fb3e
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 14, 2023
580180f
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 14, 2023
61dae8f
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 14, 2023
e086eaa
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 15, 2023
73f869a
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 15, 2023
7455648
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 15, 2023
dd32237
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 15, 2023
a1f56e0
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 15, 2023
8f7a9bf
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 15, 2023
9c59adc
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 15, 2023
094681f
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 15, 2023
3f20dd2
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 15, 2023
4f6d447
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 15, 2023
9a316c1
SPARK-45959. added new tests. Handled flattening of Project when done…
Dec 15, 2023
cfb2b04
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 15, 2023
0897f3a
Merge branch 'master' into SPARK-45959
Dec 15, 2023
9e3bd44
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 15, 2023
bbea2c4
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 16, 2023
92144cd
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 16, 2023
2176a6e
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 16, 2023
f58feca
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 16, 2023
da2cdcd
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 16, 2023
ab8a8d6
Merge branch 'master' into SPARK-45959
Dec 16, 2023
028993b
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 16, 2023
18836ed
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 18, 2023
aca2ef2
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 18, 2023
6fd6ae6
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 19, 2023
af8dc7c
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 19, 2023
6b40399
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 19, 2023
4392ac9
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 19, 2023
9660cd3
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 20, 2023
f2e7e8d
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 20, 2023
be8cf1e
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 20, 2023
0d9ea2a
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 20, 2023
49c4f4c
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 21, 2023
e1e2367
SPARK-45959. reworked and simplified the code. Instead of Collapsing …
Dec 21, 2023
d0b7765
Merge branch 'master' into SPARK-45959
Dec 21, 2023
40ac4a4
SPARK-45959.Made EarlyCollapseProject an analyzer rule
Dec 26, 2023
9a266d6
SPARK-45959.Made EarlyCollapseProject an analyzer rule
Dec 26, 2023
b35e199
SPARK-45959.added new tests and a bugfix
Dec 28, 2023
4c4d052
SPARK-45959.added new tests/ refactored previously added tests and a…
Dec 28, 2023
b5765c9
SPARK-45959.refactored previously added tests to run in cache mode an…
Dec 28, 2023
7c9415b
SPARK-45959. added more tests and a bug fix in canonicalization logic
Dec 29, 2023
f10c35a
Merge branch 'master' into SPARK-45959
Dec 29, 2023
e9c4bd1
Merge branch 'master' into SPARK-45959
Dec 29, 2023
13b8675
SPARK-45959. added a new test
Dec 29, 2023
a8c8d38
Merge branch 'master' into SPARK-45959
Dec 30, 2023
ad73f48
Merge branch 'master' into SPARK-45959
Dec 30, 2023
3f09474
Merge branch 'master' into SPARK-45959
Dec 30, 2023
d660dbb
SPARK-45959. removed code of storing of dropped columns which may n…
Jan 2, 2024
40de309
Merge branch 'master' into SPARK-45959
Jan 2, 2024
5fea69d
SPARK-45959. reverted the code of storing of dropped columns as its n…
Jan 2, 2024
dc104f9
SPARK-45959. refactored tests
Jan 2, 2024
66f5c8c
SPARK-45959. refactored tests
Jan 2, 2024
fb39833
Merge branch 'master' into SPARK-45959
Jan 3, 2024
cf859c6
SPARK-45959. rectified the golden files
Jan 3, 2024
025ee9a
SPARK-45959. refactored CacheManager code
Jan 3, 2024
f783b64
Merge branch 'master' into SPARK-45959
Jan 3, 2024
7b4d2fb
SPARK-45959. corrected the golden file
Jan 4, 2024
00ce58d
SPARK-45959. corrected the golden file. simplified early collapse pro…
Jan 4, 2024
92ec8aa
SPARK-45959. corrected the golden file. simplified early collapse pro…
Jan 4, 2024
45b03f3
SPARK-45959.refactored CacheManager code to simplify. added a new test
Jan 5, 2024
d3b7a2f
SPARK-45959.refactored CacheManager code. Handled the case of InMemor…
Jan 6, 2024
2fb1e75
SPARK-45959. added tests to validate used of nested InMemoryRelations…
Jan 9, 2024
88967d7
Merge branch 'master' into SPARK-45959
Jan 9, 2024
3742ddd
Merge branch 'master' into SPARK-45959
Mar 26, 2024
5470c86
SPARK-45959. Fixed a test corresponding to new issue SPARK-47609
Mar 27, 2024
c3dea67
SPARK-45959. Fixed scalastyle issue
Mar 27, 2024
2f7dbda
SPARK-45959. added tests for verifying plans uncaching is happening c…
Mar 28, 2024
8bfb25b
SPARK-45959. added tests for verifying plans uncaching is happening c…
Apr 4, 2024
59ff5db
SPARK-45959. added more assertions and enhanced tests to do more of c…
Apr 4, 2024
b1a1ff3
Merge branch 'apache:master' into SPARK-45959
ahshahid Apr 5, 2024
01fd0a1
Merge branch 'apache:master' into SPARK-45959
ahshahid Apr 6, 2024
67802d6
Merge branch 'apache:master' into SPARK-45959
ahshahid Apr 8, 2024
5cfbf1f
Merge branch 'master' into SPARK-45959
Apr 16, 2024
b792faf
Merge branch 'master' into SPARK-45959
Apr 24, 2024
c39be00
Merge branch 'master' into SPARK-45959
Jun 4, 2024
30accd1
SPARK-45959. fix compilation issue in merge
Jun 4, 2024
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
@@ -1,5 +1,4 @@
Project [a_b#0]
+- Project [a_b#0]
+- Aggregate [a_b#0], [a_b#0, pivotfirst(__pivot_col#0, count(1) AS count#0L, 0, 0) AS __pivot_count(1) AS count AS `count(1) AS count`#0]
+- Aggregate [CASE WHEN isnull(a#0) THEN null ELSE cast(a#0 as string) END, CASE WHEN isnull(b#0) THEN null ELSE regexp_replace(cast(b#0 as string), `, , 1) END], [CASE WHEN isnull(a#0) THEN null ELSE cast(a#0 as string) END AS a_b#0, CASE WHEN isnull(b#0) THEN null ELSE regexp_replace(cast(b#0 as string), `, , 1) END AS __pivot_col#0, count(1) AS count(1) AS count#0L]
+- LocalRelation <empty>, [id#0L, a#0, b#0]
+- Aggregate [a_b#0], [a_b#0, pivotfirst(__pivot_col#0, count(1) AS count#0L, 0, 0) AS __pivot_count(1) AS count AS `count(1) AS count`#0]
+- Aggregate [CASE WHEN isnull(a#0) THEN null ELSE cast(a#0 as string) END, CASE WHEN isnull(b#0) THEN null ELSE regexp_replace(cast(b#0 as string), `, , 1) END], [CASE WHEN isnull(a#0) THEN null ELSE cast(a#0 as string) END AS a_b#0, CASE WHEN isnull(b#0) THEN null ELSE regexp_replace(cast(b#0 as string), `, , 1) END AS __pivot_col#0, count(1) AS count(1) AS count#0L]
+- LocalRelation <empty>, [id#0L, a#0, b#0]
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Project [summary#0, element_at(id#0, summary#0, None, false) AS id#0, element_at(b#0, summary#0, None, false) AS b#0]
+- Project [id#0, b#0, summary#0]
+- Generate explode([count,mean,stddev,min,max]), false, [summary#0]
+- Aggregate [map(cast(count as string), cast(count(id#0L) as string), cast(mean as string), cast(avg(id#0L) as string), cast(stddev as string), cast(stddev(cast(id#0L as double)) as string), cast(min as string), cast(min(id#0L) as string), cast(max as string), cast(max(id#0L) as string)) AS id#0, map(cast(count as string), cast(count(b#0) as string), cast(mean as string), cast(avg(b#0) as string), cast(stddev as string), cast(stddev(b#0) as string), cast(min as string), cast(min(b#0) as string), cast(max as string), cast(max(b#0) as string)) AS b#0]
+- Project [id#0L, b#0]
+- LocalRelation <empty>, [id#0L, a#0, b#0]
+- Generate explode([count,mean,stddev,min,max]), false, [summary#0]
+- Aggregate [map(cast(count as string), cast(count(id#0L) as string), cast(mean as string), cast(avg(id#0L) as string), cast(stddev as string), cast(stddev(cast(id#0L as double)) as string), cast(min as string), cast(min(id#0L) as string), cast(max as string), cast(max(id#0L) as string)) AS id#0, map(cast(count as string), cast(count(b#0) as string), cast(mean as string), cast(avg(b#0) as string), cast(stddev as string), cast(stddev(b#0) as string), cast(min as string), cast(min(b#0) as string), cast(max as string), cast(max(b#0) as string)) AS b#0]
+- Project [id#0L, b#0]
+- LocalRelation <empty>, [id#0L, a#0, b#0]
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Project [summary#0, element_at(id#0, summary#0, None, false) AS id#0, element_at(a#0, summary#0, None, false) AS a#0, element_at(b#0, summary#0, None, false) AS b#0]
+- Project [id#0, a#0, b#0, summary#0]
+- Generate explode([mean,min]), false, [summary#0]
+- Aggregate [map(cast(mean as string), cast(avg(id#0L) as string), cast(min as string), cast(min(id#0L) as string)) AS id#0, map(cast(mean as string), cast(avg(a#0) as string), cast(min as string), cast(min(a#0) as string)) AS a#0, map(cast(mean as string), cast(avg(b#0) as string), cast(min as string), cast(min(b#0) as string)) AS b#0]
+- LocalRelation <empty>, [id#0L, a#0, b#0]
+- Generate explode([mean,min]), false, [summary#0]
+- Aggregate [map(cast(mean as string), cast(avg(id#0L) as string), cast(min as string), cast(min(id#0L) as string)) AS id#0, map(cast(mean as string), cast(avg(a#0) as string), cast(min as string), cast(min(a#0) as string)) AS a#0, map(cast(mean as string), cast(avg(b#0) as string), cast(min as string), cast(min(b#0) as string)) AS b#0]
+- LocalRelation <empty>, [id#0L, a#0, b#0]
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import org.apache.spark.sql.types._
import org.apache.spark.sql.types.DayTimeIntervalType.DAY
import org.apache.spark.sql.util.CaseInsensitiveStringMap
import org.apache.spark.util.ArrayImplicits._
import org.apache.spark.util.Utils

/**
* A trivial [[Analyzer]] with a dummy [[SessionCatalog]] and
Expand Down Expand Up @@ -212,7 +213,12 @@ class Analyzer(override val catalogManager: CatalogManager) extends RuleExecutor
AnalysisHelper.markInAnalyzer {
val analyzed = executeAndTrack(plan, tracker)
checkAnalysis(analyzed)
analyzed
val excludedPostAnalysisRulesConf =
conf.postAnalysisExcludesRules.toSeq.flatMap(Utils.stringToSeq)
postAnalysisEarlyOptimizationRules.filterNot(
rule => excludedPostAnalysisRulesConf.contains(rule.ruleName)).foldLeft(analyzed) {
case(rs, rule) => rule(rs)
}
}
}

Expand Down Expand Up @@ -248,6 +254,8 @@ class Analyzer(override val catalogManager: CatalogManager) extends RuleExecutor
*/
val postHocResolutionRules: Seq[Rule[LogicalPlan]] = Nil

val postAnalysisEarlyOptimizationRules: Seq[Rule[LogicalPlan]] = Nil

private def typeCoercionRules(): List[Rule[LogicalPlan]] = if (conf.ansiEnabled) {
AnsiTypeCoercion.typeCoercionRules
} else {
Expand Down Expand Up @@ -356,6 +364,8 @@ class Analyzer(override val catalogManager: CatalogManager) extends RuleExecutor
Batch("HandleSpecialCommand", Once,
HandleSpecialCommand),
Batch("Remove watermark for batch query", Once,
EliminateEventTimeWatermark),
Batch("Remove watermark for batch query", Once,
EliminateEventTimeWatermark)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,39 @@ trait ColumnResolutionHelper extends Logging with DataTypeErrorsBase {
val (newExprs, newChild) = {
// Resolving expressions against current plan.
val maybeResolvedExprs = exprs.map(resolveExpressionByPlanOutput(_, u))

// Recursively resolving expressions on the child of current plan.
resolveExprsAndAddMissingAttrs(maybeResolvedExprs, u.child)
}
// If some attributes used by expressions are resolvable only on the rewritten child
// plan, we need to add them into original projection.
lazy val missingAttrs =
(AttributeSet(newExprs) -- u.outputSet).intersect(newChild.outputSet)
val (missingAttrsFromOutput, missingAttrsFromDroppedAttr) = {
val missing1 = AttributeSet(newExprs) -- u.outputSet
val fulfilledFromOutput = missing1.intersect(newChild.outputSet)
val missing2 = missing1 -- fulfilledFromOutput
val fulfilledFromDroppedCol = missing2.intersect(u.getTagValue(
LogicalPlan.DROPPED_NAMED_EXPRESSIONS).
map(sq => AttributeSet(sq.map(_.toAttribute))).getOrElse(AttributeSet.empty))
fulfilledFromOutput -> fulfilledFromDroppedCol
}
u match {
case p: Project =>
val newProject = Project(p.projectList ++ missingAttrs, newChild)
val droppedNamedExprs = p.getTagValue(LogicalPlan.DROPPED_NAMED_EXPRESSIONS).
getOrElse(Seq.empty)
val newProject = Project(p.projectList ++ missingAttrsFromOutput ++
missingAttrsFromDroppedAttr.map(attr =>
droppedNamedExprs.find(_.toAttribute.canonicalized == attr.canonicalized).get),
newChild)
newProject.copyTagsFrom(p)
(newExprs, newProject)

case a @ Aggregate(groupExprs, aggExprs, child) =>
if (missingAttrs.forall(attr => groupExprs.exists(_.semanticEquals(attr)))) {
case a @ Aggregate(groupExprs, aggExprs, _) =>
if (missingAttrsFromOutput.forall(attr =>
groupExprs.exists(_.semanticEquals(attr)))) {
// All the missing attributes are grouping expressions, valid case.
(newExprs,
a.copy(aggregateExpressions = aggExprs ++ missingAttrs, child = newChild))
a.copy(aggregateExpressions = aggExprs ++ missingAttrsFromOutput,
child = newChild))
} else {
// Need to add non-grouping attributes, invalid case.
(exprs, a)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ abstract class LogicalPlan

private[this] lazy val outputAttributes = AttributeSeq.fromNormalOutput(output)

private[this] lazy val droppedAttributes = this.getTagValue(
LogicalPlan.DROPPED_NAMED_EXPRESSIONS).map(_.map(_.toAttribute)).getOrElse(Seq.empty)

private[this] lazy val outputMetadataAttributes = AttributeSeq(metadataOutput)

/**
Expand All @@ -158,7 +161,8 @@ abstract class LogicalPlan
nameParts: Seq[String],
resolver: Resolver): Option[NamedExpression] =
outputAttributes.resolve(nameParts, resolver)
.orElse(outputMetadataAttributes.resolve(nameParts, resolver))
.orElse(outputMetadataAttributes.resolve(nameParts, resolver)).orElse(
droppedAttributes.resolve(nameParts, resolver))

/**
* Given an attribute name, split it to name parts by dot, but
Expand Down Expand Up @@ -202,6 +206,8 @@ object LogicalPlan {
// to the old code path.
private[spark] val PLAN_ID_TAG = TreeNodeTag[Long]("plan_id")
private[spark] val IS_METADATA_COL = TreeNodeTag[Unit]("is_metadata_col")
private[spark] val DROPPED_NAMED_EXPRESSIONS =
TreeNodeTag[Seq[NamedExpression]]("dropped_namedexprs")
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,14 @@ object SQLConf {
}
}

val EXCLUDE_POST_ANALYSIS_RULES =
buildConf("spark.sql.analyzer.excludePostAnalysisRules")
.internal()
.doc("The names of the comma separated post analysis rules to be excluded")
.version("3.5.0")
.stringConf
.createOptional

val ANALYZER_MAX_ITERATIONS = buildConf("spark.sql.analyzer.maxIterations")
.internal()
.doc("The max number of iterations the analyzer runs.")
Expand Down Expand Up @@ -5159,6 +5167,8 @@ class SQLConf extends Serializable with Logging with SqlApiConf {

def analyzerMaxIterations: Int = getConf(ANALYZER_MAX_ITERATIONS)

def postAnalysisExcludesRules: Option[String] = getConf(EXCLUDE_POST_ANALYSIS_RULES)

def optimizerExcludedRules: Option[String] = getConf(OPTIMIZER_EXCLUDED_RULES)

def optimizerMaxIterations: Int = getConf(OPTIMIZER_MAX_ITERATIONS)
Expand Down
3 changes: 2 additions & 1 deletion sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3890,7 +3890,8 @@ class Dataset[T] private[sql](
*/
def storageLevel: StorageLevel = {
sparkSession.sharedState.cacheManager.lookupCachedData(this).map { cachedData =>
cachedData.cachedRepresentation.cacheBuilder.storageLevel
cachedData.cachedRepresentation.fold(CacheManager.inMemoryRelationExtractor, identity).
cacheBuilder.storageLevel
}.getOrElse(StorageLevel.NONE)
}

Expand Down
Loading