File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
sql/core/src/test/scala/org/apache/spark/sql/execution Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 17
17
18
18
package org .apache .spark .sql .execution
19
19
20
- import org .apache .spark .sql .catalyst .expressions .{BoundReference , Ascending , SortOrder }
21
20
import org .apache .spark .sql .catalyst .dsl .expressions ._
22
21
23
- import org .apache .spark .sql .test .TestSQLContext
24
- import org .apache .spark .sql .types .{IntegerType , StringType }
25
-
26
22
class SortSuite extends SparkPlanTest {
27
- import TestSQLContext .implicits .localSeqToDataFrameHolder
28
23
29
24
test(" basic sorting using ExternalSort" ) {
30
25
Original file line number Diff line number Diff line change 17
17
18
18
package org .apache .spark .sql .execution
19
19
20
- import scala .util . control . NonFatal
20
+ import scala .language . implicitConversions
21
21
import scala .reflect .runtime .universe .TypeTag
22
+ import scala .util .control .NonFatal
22
23
23
24
import org .apache .spark .SparkFunSuite
24
25
@@ -27,14 +28,21 @@ import org.apache.spark.sql.catalyst.expressions.BoundReference
27
28
import org .apache .spark .sql .catalyst .util ._
28
29
29
30
import org .apache .spark .sql .test .TestSQLContext
30
- import org .apache .spark .sql .{Row , DataFrame }
31
+ import org .apache .spark .sql .{DataFrameHolder , Row , DataFrame }
31
32
32
33
/**
33
34
* Base class for writing tests for individual physical operators. For an example of how this
34
35
* class's test helper methods can be used, see [[SortSuite ]].
35
36
*/
36
37
class SparkPlanTest extends SparkFunSuite {
37
38
39
+ /**
40
+ * Creates a DataFrame from a local Seq of Product.
41
+ */
42
+ implicit def localSeqToDataFrameHolder [A <: Product : TypeTag ](data : Seq [A ]): DataFrameHolder = {
43
+ TestSQLContext .implicits.localSeqToDataFrameHolder(data)
44
+ }
45
+
38
46
/**
39
47
* Runs the plan and makes sure the answer matches the expected result.
40
48
* @param input the input data to be used.
You can’t perform that action at this time.
0 commit comments