From 3d79166d9fde654a94bdf887672f1af02d75cc25 Mon Sep 17 00:00:00 2001 From: Yadid Ayzenberg Date: Sat, 31 May 2014 19:44:13 -0700 Subject: 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 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 (cherry picked from commit 366c0c4c30465be1a298a5c750b6dbbf022c2323) Signed-off-by: Reynold Xin --- docs/sql-programming-guide.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/sql-programming-guide.md b/docs/sql-programming-guide.md index a506457eba..4623bb4247 100644 --- a/docs/sql-programming-guide.md +++ b/docs/sql-programming-guide.md @@ -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 people = ctx.textFile("examples/src/main/resources/people.txt").map( -- cgit v1.2.3