diff options
author | Fei Wang <wangfei1@huawei.com> | 2015-04-13 18:23:35 -0700 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2015-04-13 18:23:35 -0700 |
commit | 3782e1f2bec07b5ffbc8503e40591e96fce67256 (patch) | |
tree | eb1df1c884ec7bc71210ab70bb58c10cb8ced0b7 | |
parent | 435b8779df01a7477addecb1023605957bca4e9b (diff) | |
download | spark-3782e1f2bec07b5ffbc8503e40591e96fce67256.tar.gz spark-3782e1f2bec07b5ffbc8503e40591e96fce67256.tar.bz2 spark-3782e1f2bec07b5ffbc8503e40591e96fce67256.zip |
[SQL] [Minor] Fix for SqlApp.scala
SqlApp.scala is out of date.
Author: Fei Wang <wangfei1@huawei.com>
Closes #5485 from scwf/patch-1 and squashes the following commits:
6f731c2 [Fei Wang] SqlApp.scala compile error
-rw-r--r-- | dev/audit-release/sbt_app_sql/src/main/scala/SqlApp.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dev/audit-release/sbt_app_sql/src/main/scala/SqlApp.scala b/dev/audit-release/sbt_app_sql/src/main/scala/SqlApp.scala index d888de929f..cc86ef4585 100644 --- a/dev/audit-release/sbt_app_sql/src/main/scala/SqlApp.scala +++ b/dev/audit-release/sbt_app_sql/src/main/scala/SqlApp.scala @@ -36,8 +36,10 @@ object SparkSqlExample { val sc = new SparkContext(conf) val sqlContext = new SQLContext(sc) + import sqlContext.implicits._ import sqlContext._ - val people = sc.makeRDD(1 to 100, 10).map(x => Person(s"Name$x", x)) + + val people = sc.makeRDD(1 to 100, 10).map(x => Person(s"Name$x", x)).toDF() people.registerTempTable("people") val teenagers = sql("SELECT name FROM people WHERE age >= 13 AND age <= 19") val teenagerNames = teenagers.map(t => "Name: " + t(0)).collect() |