updated java code blocks in spark SQL guide such that ctx will refer to ...
...a JavaSparkContext and sqlCtx will refer to a JavaSQLContext Author: Yadid Ayzenberg <yadid@media.mit.edu> Closes #932 from yadid/master and squashes the following commits: f92fb3a [Yadid Ayzenberg] updated java code blocks in spark SQL guide such that ctx will refer to a JavaSparkContext and sqlCtx will refer to a JavaSQLContext
This commit is contained in:
parent
5e98967b61
commit
366c0c4c30
|
@ -170,7 +170,9 @@ A schema can be applied to an existing RDD by calling `applySchema` and providin
|
|||
for the JavaBean.
|
||||
|
||||
{% highlight java %}
|
||||
JavaSQLContext ctx = new org.apache.spark.sql.api.java.JavaSQLContext(sc)
|
||||
|
||||
JavaSparkContext ctx = ...; // An existing JavaSparkContext.
|
||||
JavaSQLContext sqlCtx = new org.apache.spark.sql.api.java.JavaSQLContext(ctx)
|
||||
|
||||
// Load a text file and convert each line to a JavaBean.
|
||||
JavaRDD<Person> people = ctx.textFile("examples/src/main/resources/people.txt").map(
|
||||
|
|
Loading…
Reference in a new issue