Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2a1cd27
optimization + test
bogdanrdc Aug 23, 2018
421ee20
debug benchmark + early batch
bogdanrdc Aug 23, 2018
d7e49e7
revert benchmark
bogdanrdc Aug 23, 2018
ba6d91e
Merge remote-tracking branch 'upstream/master' into local-relation-fi…
bogdanrdc Aug 24, 2018
326e5d7
test fix
bogdanrdc Aug 24, 2018
4263bd2
[SPARK-25073][YARN] AM and Executor Memory validation message is not …
sujith71955 Aug 24, 2018
f84d256
[SPARK-25214][SS] Fix the issue that Kafka v2 source may return dupli…
zsxwing Aug 24, 2018
c721895
[SPARK-25174][YARN] Limit the size of diagnostic message for am to un…
yaooqinn Aug 24, 2018
f8536e3
[SPARK-25234][SPARKR] avoid integer overflow in parallelize
mengxr Aug 24, 2018
af6a91e
Correct missing punctuation in the documentation
Aug 25, 2018
c613c6b
[MINOR] Fix Scala 2.12 build
dbtsai Aug 25, 2018
ee1c0e8
[SPARK-24688][EXAMPLES] Modify the comments about LabeledPoint
huangweizhe123 Aug 25, 2018
77fb55e
[SPARK-25214][SS][FOLLOWUP] Fix the issue that Kafka v2 source may re…
zsxwing Aug 25, 2018
b00824c
[SPARK-23792][DOCS] Documentation improvements for datetime functions
abradbury Aug 26, 2018
ee6cb6c
[SPARK-23698][PYTHON][FOLLOWUP] Resolve undefiend names in setup.py
HyukjinKwon Aug 27, 2018
c129176
[SPARK-19355][SQL][FOLLOWUP] Remove the child.outputOrdering check in…
viirya Aug 27, 2018
368b42f
[SPARK-24978][SQL] Add spark.sql.fast.hash.aggregate.row.max.capacity…
heary-cao Aug 27, 2018
0378b1f
[SPARK-25249][CORE][TEST] add a unit test for OpenHashMap
10110346 Aug 27, 2018
d5a953a
[SPARK-24882][FOLLOWUP] Fix flaky synchronization in Kafka tests.
jose-torres Aug 27, 2018
3598483
[SPARK-24149][YARN][FOLLOW-UP] Only get the delegation tokens of the …
wangyum Aug 27, 2018
397fa62
[SPARK-24090][K8S] Update running-on-kubernetes.md
liyinan926 Aug 27, 2018
dcd001b
[SPARK-24721][SQL] Exclude Python UDFs filters in FileSourceStrategy
icexelloss Aug 28, 2018
b23538b
[SPARK-25218][CORE] Fix potential resource leaks in TransportServer a…
zsxwing Aug 28, 2018
f769a94
[SPARK-25005][SS] Support non-consecutive offsets for Kafka
zsxwing Aug 28, 2018
68c41ff
comment
bogdanrdc Aug 28, 2018
dad6a7f
Merge remote-tracking branch 'upstream/master' into local-relation-fi…
bogdanrdc Aug 28, 2018
cb067c3
Merge remote-tracking branch 'upstream/master' into local-relation-fi…
bogdanrdc Aug 28, 2018
d552cc1
space
bogdanrdc Aug 28, 2018
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
Prev Previous commit
Next Next commit
[SPARK-19355][SQL][FOLLOWUP] Remove the child.outputOrdering check in…
… global limit

## What changes were proposed in this pull request?

This is based on the discussion https://github.com/apache/spark/pull/16677/files#r212805327.

As SQL standard doesn't mandate that a nested order by followed by a limit has to respect that ordering clause, this patch removes the `child.outputOrdering` check.

## How was this patch tested?

Unit tests.

Closes #22239 from viirya/improve-global-limit-parallelism-followup.

Authored-by: Liang-Chi Hsieh <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
  • Loading branch information
viirya authored and bogdanrdc committed Aug 28, 2018
commit c1291765ada7798f5d24fb39f206dee7ac8df551
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ case class GlobalLimitExec(limit: Int, child: SparkPlan) extends UnaryExecNode {
Nil
}

// During global limit, try to evenly distribute limited rows across data
// partitions. If disabled, scanning data partitions sequentially until reaching limit number.
// Besides, if child output has certain ordering, we can't evenly pick up rows from
// each parititon.
val flatGlobalLimit = sqlContext.conf.limitFlatGlobalLimit && child.outputOrdering == Nil
// This is an optimization to evenly distribute limited rows across all partitions.
// When enabled, Spark goes to take rows at each partition repeatedly until reaching
// limit number. When disabled, Spark takes all rows at first partition, then rows
// at second partition ..., until reaching limit number.
val flatGlobalLimit = sqlContext.conf.limitFlatGlobalLimit

val shuffled = new ShuffledRowRDD(shuffleDependency)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import scala.util.Random
import org.apache.spark.sql.{DataFrame, Row}
import org.apache.spark.sql.catalyst.dsl.expressions._
import org.apache.spark.sql.catalyst.expressions.Literal
import org.apache.spark.sql.internal.SQLConf
import org.apache.spark.sql.test.SharedSQLContext
import org.apache.spark.sql.types._

Expand All @@ -31,10 +32,19 @@ class TakeOrderedAndProjectSuite extends SparkPlanTest with SharedSQLContext {
private var rand: Random = _
private var seed: Long = 0

private val originalLimitFlatGlobalLimit = SQLConf.get.getConf(SQLConf.LIMIT_FLAT_GLOBAL_LIMIT)

protected override def beforeAll(): Unit = {
super.beforeAll()
seed = System.currentTimeMillis()
rand = new Random(seed)

// Disable the optimization to make Sort-Limit match `TakeOrderedAndProject` semantics.
SQLConf.get.setConf(SQLConf.LIMIT_FLAT_GLOBAL_LIMIT, false)
}

protected override def afterAll() = {
SQLConf.get.setConf(SQLConf.LIMIT_FLAT_GLOBAL_LIMIT, originalLimitFlatGlobalLimit)
}

private def generateRandomInputData(): DataFrame = {
Expand Down