Skip to content

Commit

Permalink
[SQL] [Minor] Fix for SqlApp.scala
Browse files Browse the repository at this point in the history
SqlApp.scala is out of date.

Author: Fei Wang <[email protected]>

Closes apache#5485 from scwf/patch-1 and squashes the following commits:

6f731c2 [Fei Wang] SqlApp.scala compile error
  • Loading branch information
scwf authored and marmbrus committed Apr 14, 2015
1 parent 435b877 commit 3782e1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dev/audit-release/sbt_app_sql/src/main/scala/SqlApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3782e1f

Please sign in to comment.