Repository: incubator-zeppelin Updated Branches: refs/heads/master d6446d707 -> bd658e7c3
Remove sqlContext creation from tutorial notebook Remove sqlContext creation from tutorial notebook. sqlContext is supposed to created and injected by Zeppelin. Author: Lee moon soo <[email protected]> Closes #102 from Leemoonsoo/update_tutorial and squashes the following commits: 8818a6a [Lee moon soo] Remove sqlContext creation from tutorial notebook Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/bd658e7c Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/bd658e7c Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/bd658e7c Branch: refs/heads/master Commit: bd658e7c359a78926c267e38004c04d48fd17b07 Parents: d6446d7 Author: Lee moon soo <[email protected]> Authored: Sat Jun 13 09:19:36 2015 -0700 Committer: Alexander Bezzubov <[email protected]> Committed: Wed Jun 17 10:50:52 2015 +0900 ---------------------------------------------------------------------- notebook/2A94M5J1Z/note.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/bd658e7c/notebook/2A94M5J1Z/note.json ---------------------------------------------------------------------- diff --git a/notebook/2A94M5J1Z/note.json b/notebook/2A94M5J1Z/note.json index 86485dd..a37cf19 100644 --- a/notebook/2A94M5J1Z/note.json +++ b/notebook/2A94M5J1Z/note.json @@ -67,7 +67,7 @@ }, { "title": "Load data into table", - "text": "import sys.process._\n// sc is an existing SparkContext.\nval sqlContext \u003d new org.apache.spark.sql.SQLContext(sc)\n\n\nval zeppelinHome \u003d (\"pwd\" !!).replace(\"\\n\", \"\")\nval bankText \u003d sc.textFile(s\"file://$zeppelinHome/data/bank-full.csv\")\n\ncase class Bank(age: Integer, job: String, marital: String, education: String, balance: Integer)\n\nval bank \u003d bankText.map(s \u003d\u003e s.split(\";\")).filter(s \u003d\u003e s(0) !\u003d \"\\\"age\\\"\").map(\n s \u003d\u003e Bank(s(0).toInt, \n s(1).replaceAll(\"\\\"\", \"\"),\n s(2).replaceAll(\"\\\"\", \"\"),\n s(3).replaceAll(\"\\\"\", \"\"),\n s(5).replaceAll(\"\\\"\", \"\").toInt\n )\n).toDF()\nbank.registerTempTable(\"bank\")\n\n", + "text": "import sys.process._\n// Zeppelin creates and injects sc (SparkContext) and sqlContext (HiveContext or SqlContext)\n// So you don\u0027t need create them manually\n\nval zeppelinHome \u003d (\"pwd\" !!).replace(\"\\n\", \"\")\nval bankText \u003d sc.textFile(s\"file://$zeppelinHome/data/bank-full.csv\")\n\ncase class Bank(age: Integer, job: String, marital: String, education: String, balance: Integer)\n\nval bank \u003d bankText.map(s \u003d\u003e s.split(\";\")).filter(s \u003d\u003e s(0) !\u003d \"\\\"age\\\"\").map(\n s \u003d\u003e Bank(s(0).toInt, \n s(1).replaceAll(\"\\\"\", \"\"),\n s(2).replaceAll(\"\\\"\", \"\"),\n s(3).replaceAll(\"\\\"\", \"\"),\n s(5).replaceAll(\"\\\"\", \"\").toInt\n )\n).toDF()\nbank.registerTempTable(\"bank\")\n\n", "config": { "colWidth": 12.0, "graph": { @@ -337,4 +337,4 @@ "looknfeel": "default" }, "info": {} -} \ No newline at end of file +}
