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 1717
1818package org .apache .spark .sql .execution
1919
20- import org .apache .spark .sql .catalyst .expressions .{BoundReference , Ascending , SortOrder }
2120import org .apache .spark .sql .catalyst .dsl .expressions ._
2221
23- import org .apache .spark .sql .test .TestSQLContext
24- import org .apache .spark .sql .types .{IntegerType , StringType }
25-
2622class SortSuite extends SparkPlanTest {
27- import TestSQLContext .implicits .localSeqToDataFrameHolder
2823
2924 test(" basic sorting using ExternalSort" ) {
3025
Original file line number Diff line number Diff line change 1717
1818package org .apache .spark .sql .execution
1919
20- import scala .util . control . NonFatal
20+ import scala .language . implicitConversions
2121import scala .reflect .runtime .universe .TypeTag
22+ import scala .util .control .NonFatal
2223
2324import org .apache .spark .SparkFunSuite
2425
@@ -27,14 +28,21 @@ import org.apache.spark.sql.catalyst.expressions.BoundReference
2728import org .apache .spark .sql .catalyst .util ._
2829
2930import org .apache .spark .sql .test .TestSQLContext
30- import org .apache .spark .sql .{Row , DataFrame }
31+ import org .apache .spark .sql .{DataFrameHolder , Row , DataFrame }
3132
3233/**
3334 * Base class for writing tests for individual physical operators. For an example of how this
3435 * class's test helper methods can be used, see [[SortSuite ]].
3536 */
3637class SparkPlanTest extends SparkFunSuite {
3738
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+
3846 /**
3947 * Runs the plan and makes sure the answer matches the expected result.
4048 * @param input the input data to be used.
You can’t perform that action at this time.
0 commit comments