File tree Expand file tree Collapse file tree 4 files changed +7
-8
lines changed
catalyst/src/main/scala/org/apache/spark/sql/types
main/scala/org/apache/spark/sql
test/scala/org/apache/spark/sql Expand file tree Collapse file tree 4 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -822,7 +822,8 @@ case class StructType(fields: Array[StructField]) extends DataType with Seq[Stru
822
822
* have a name matching the given name, `null` will be returned.
823
823
*/
824
824
def apply (name : String ): StructField = {
825
- nameToField.getOrElse(name, throw new IllegalArgumentException (s " Field $name does not exist. " ))
825
+ nameToField.getOrElse(name,
826
+ throw new IllegalArgumentException (s """ Field " $name" does not exist. """ ))
826
827
}
827
828
828
829
/**
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ import org.apache.spark.sql.types.StructType
31
31
32
32
private [sql] object DataFrame {
33
33
def apply (sqlContext : SQLContext , logicalPlan : LogicalPlan ): DataFrame = {
34
- new DataFrameImpl (sqlContext, sqlContext.executePlan( logicalPlan) )
34
+ new DataFrameImpl (sqlContext, logicalPlan)
35
35
}
36
36
}
37
37
Original file line number Diff line number Diff line change @@ -260,7 +260,7 @@ private[sql] class DataFrameImpl protected[sql](
260
260
261
261
override def take (n : Int ): Array [Row ] = head(n)
262
262
263
- override def collect (): Array [Row ] = rdd.collect ()
263
+ override def collect (): Array [Row ] = queryExecution.executedPlan.executeCollect ()
264
264
265
265
override def collectAsList (): java.util.List [Row ] = java.util.Arrays .asList(rdd.collect() :_* )
266
266
Original file line number Diff line number Diff line change @@ -36,11 +36,9 @@ class DataFrameSuite extends QueryTest {
36
36
intercept[Exception ] {
37
37
testData.groupBy(" nonExistentName" ).agg(Map (" key" -> " sum" ))
38
38
}
39
-
40
- // Uncomment the following once we report the errors properly.
41
- // intercept[Exception] {
42
- // testData.groupBy("nonExistentName").agg(Map("key" -> "sum"))
43
- // }
39
+ intercept[Exception ] {
40
+ testData.groupBy($" abcd" ).agg(Map (" key" -> " sum" ))
41
+ }
44
42
}
45
43
46
44
test(" table scan" ) {
You can’t perform that action at this time.
0 commit comments