File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed
sql/core/src/test/scala/org/apache/spark/sql Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -582,6 +582,24 @@ trait QueryTestBase extends PlanTestBase
582582 s " ${cs.getClassName}. ${cs.getMethodName}( ${cs.getFileName}: ${cs.getLineNumber + lines}) " )
583583 }
584584
585+ // Whether to materialize all test data before the first test is run
586+ private var loadTestDataBeforeTests = false
587+
588+ protected override def beforeAll (): Unit = {
589+ super .beforeAll()
590+ if (loadTestDataBeforeTests) {
591+ loadTestData()
592+ }
593+ }
594+
595+ /**
596+ * Materialize the test data immediately after the `SQLContext` is set up.
597+ * This is necessary if the data is accessed by name but not through direct reference.
598+ */
599+ protected def setupTestData (): Unit = {
600+ loadTestDataBeforeTests = true
601+ }
602+
585603}
586604
587605abstract class QueryTest extends SparkFunSuite with QueryTestBase with PlanTest
Original file line number Diff line number Diff line change @@ -45,16 +45,6 @@ private[sql] trait SQLTestUtilsBase extends QueryTestBase { self: Suite => }
4545 * code base.
4646 */
4747private [sql] trait SQLTestUtils extends SparkFunSuite with SQLTestUtilsBase with PlanTest {
48- // Whether to materialize all test data before the first test is run
49- private var loadTestDataBeforeTests = false
50-
51- protected override def beforeAll (): Unit = {
52- super .beforeAll()
53- if (loadTestDataBeforeTests) {
54- loadTestData()
55- }
56- }
57-
5848 /**
5949 * Creates a temporary directory, which is then passed to `f` and will be deleted after `f`
6050 * returns.
@@ -80,14 +70,6 @@ private[sql] trait SQLTestUtils extends SparkFunSuite with SQLTestUtilsBase with
8070 }
8171 }
8272
83- /**
84- * Materialize the test data immediately after the `SQLContext` is set up.
85- * This is necessary if the data is accessed by name but not through direct reference.
86- */
87- protected def setupTestData (): Unit = {
88- loadTestDataBeforeTests = true
89- }
90-
9173 /**
9274 * Disable stdout and stderr when running the test. To not output the logs to the console,
9375 * ConsoleAppender's `follow` should be set to `true` so that it will honor reassignments of
You can’t perform that action at this time.
0 commit comments