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
822822 * have a name matching the given name, `null` will be returned.
823823 */
824824 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. """ ))
826827 }
827828
828829 /**
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ import org.apache.spark.sql.types.StructType
3131
3232private [sql] object DataFrame {
3333 def apply (sqlContext : SQLContext , logicalPlan : LogicalPlan ): DataFrame = {
34- new DataFrameImpl (sqlContext, sqlContext.executePlan( logicalPlan) )
34+ new DataFrameImpl (sqlContext, logicalPlan)
3535 }
3636}
3737
Original file line number Diff line number Diff line change @@ -260,7 +260,7 @@ private[sql] class DataFrameImpl protected[sql](
260260
261261 override def take (n : Int ): Array [Row ] = head(n)
262262
263- override def collect (): Array [Row ] = rdd.collect ()
263+ override def collect (): Array [Row ] = queryExecution.executedPlan.executeCollect ()
264264
265265 override def collectAsList (): java.util.List [Row ] = java.util.Arrays .asList(rdd.collect() :_* )
266266
Original file line number Diff line number Diff line change @@ -36,11 +36,9 @@ class DataFrameSuite extends QueryTest {
3636 intercept[Exception ] {
3737 testData.groupBy(" nonExistentName" ).agg(Map (" key" -> " sum" ))
3838 }
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+ }
4442 }
4543
4644 test(" table scan" ) {
You can’t perform that action at this time.
0 commit comments