Skip to content

Commit 2f2fb89

Browse files
Fix statistics for SparkLogicalPlan.
1 parent 9951305 commit 2f2fb89

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/SparkPlan.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,12 @@ case class SparkLogicalPlan(alreadyPlanned: SparkPlan)(@transient sqlContext: SQ
8282
}
8383

8484
@transient override lazy val statistics = Statistics(
85-
// If this is wrapping around ExistingRdd and no reasonable estimation logic is implemented,
86-
// return a default value.
8785
sizeInBytes = {
88-
val naiveVal = childrenStats.map(_.sizeInBytes).product
8986
alreadyPlanned match {
9087
// TODO: Instead of returning a default value here, find a way to return a meaningful
9188
// size estimate for RDDs. See PR 1238 for more discussions.
92-
case e: ExistingRdd if naiveVal == 1L => sqlContext.statsDefaultSizeInBytes
93-
case _ => naiveVal
89+
case e: ExistingRdd => sqlContext.statsDefaultSizeInBytes
90+
case _ => 1L // TODO: consider adding statistics to physical plans as well.
9491
}
9592
}
9693
)

0 commit comments

Comments
 (0)