Skip to content

[SPARK-20281][SQL] Print the identical Range parameters of SparkContext APIs and SQL in explain #17670

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

Closed
wants to merge 4 commits 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 @@ -332,6 +332,7 @@ case class RangeExec(range: org.apache.spark.sql.catalyst.plans.logical.Range)
extends LeafExecNode with CodegenSupport {

def start: Long = range.start
def end: Long = range.end
def step: Long = range.step
def numSlices: Int = range.numSlices.getOrElse(sparkContext.defaultParallelism)
def numElements: BigInt = range.numElements
Expand Down Expand Up @@ -540,7 +541,7 @@ case class RangeExec(range: org.apache.spark.sql.catalyst.plans.logical.Range)
}
}

override def simpleString: String = range.simpleString
override def simpleString: String = s"Range ($start, $end, step=$step, splits=$numSlices)"
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Project [coalesce(cast(id#xL as string), x) AS ifnull(`id`, 'x')#x, id#xL AS nul

== Physical Plan ==
*Project [coalesce(cast(id#xL as string), x) AS ifnull(`id`, 'x')#x, id#xL AS nullif(`id`, 'x')#xL, coalesce(cast(id#xL as string), x) AS nvl(`id`, 'x')#x, x AS nvl2(`id`, 'x', 'y')#x]
+- *Range (0, 2, step=1, splits=None)
+- *Range (0, 2, step=1, splits=2)


-- !query 9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ EXPLAIN select * from RaNgE(2)
struct<plan:string>
-- !query 8 output
== Physical Plan ==
*Range (0, 2, step=1, splits=None)
*Range (0, 2, step=1, splits=2)