Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/8602#discussion_r38783018
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/test/TestSQLContext.scala ---
@@ -31,13 +31,24 @@ private[sql] class TestSQLContext(sc: SparkContext)
extends SQLContext(sc) { sel
new SparkConf().set("spark.sql.testkey", "true")))
}
- // Use fewer partitions to speed up testing
+ // At here, we make sure we set those test specific confs correctly when
we create
+ // the SQLConf as well as when we call clear.
protected[sql] override def createSession(): SQLSession = new
this.SQLSession()
- /** A special [[SQLSession]] that uses fewer shuffle partitions than
normal. */
protected[sql] class SQLSession extends super.SQLSession {
protected[sql] override lazy val conf: SQLConf = new SQLConf {
- override def numShufflePartitions: Int =
this.getConf(SQLConf.SHUFFLE_PARTITIONS, 5)
+
+ TestSQLContext.overrideConfs.map {
+ case (key, value) => setConfString(key, value)
+ }
+
+ override def clear(): Unit = {
+ super.clear()
+
+ TestSQLContext.overrideConfs.map {
--- End diff --
can you add a comment here: `// Make sure we start with the default test
configs even after clear`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]