Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-39606][SQL] Use child stats to estimate order operator #36994

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -102,9 +102,7 @@ object BasicStatsPlanVisitor extends LogicalPlanVisitor[Statistics] {

override def visitWindow(p: Window): Statistics = fallback(p)

override def visitSort(p: Sort): Statistics = {
BasicStatsPlanVisitor.visit(p.child)
}
override def visitSort(p: Sort): Statistics = fallback(p)

override def visitTail(p: Tail): Statistics = {
fallback(p)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ object SizeInBytesOnlyStatsPlanVisitor extends LogicalPlanVisitor[Statistics] {

override def visitWindow(p: Window): Statistics = visitUnaryNode(p)

override def visitSort(p: Sort): Statistics = default(p)
override def visitSort(p: Sort): Statistics = p.child.stats

override def visitTail(p: Tail): Statistics = {
val limit = p.limitExpr.eval().asInstanceOf[Int]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ class BasicStatsEstimationSuite extends PlanTest with StatsEstimationTestBase {
checkStats(
sort,
expectedStatsCboOn = expectedSortStats,
expectedStatsCboOff = Statistics(sizeInBytes = expectedSize))
expectedStatsCboOff = expectedSortStats)
}

/** Check estimated stats when cbo is turned on/off. */
Expand Down