{"paragraphs":[{"text":"%md\n## Welcome to Zeppelin.\n##### This is a live tutorial, you can run the code yourself. (Shift-Enter to Run)","config":{"colWidth":12,"graph":{"mode":"table","height":300,"optionOpen":false,"keys":[],"values":[],"groups":[],"scatter":{}},"editorHide":true,"enabled":true,"editorMode":"ace/mode/markdown"},"settings":{"params":{},"forms":{}},"jobName":"paragraph_1423836981412_-1007008116","id":"20150213-231621_168813393","result":{"code":"SUCCESS","type":"HTML","msg":"

Welcome to Zeppelin.

\n
This is a live tutorial, you can run the code yourself. (Shift-Enter to Run)
\n"},"dateCreated":"2015-02-13T11:16:21+0000","dateStarted":"2015-04-01T09:11:09+0000","dateFinished":"2015-04-01T09:11:10+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:187"},{"title":"Load data into table","text":"import org.apache.commons.io.IOUtils\nimport java.net.URL\nimport java.nio.charset.Charset\n\n// Zeppelin creates and injects sc (SparkContext) and sqlContext (HiveContext or SqlContext)\n// So you don't need create them manually\n\n// load bank data\nval bankText = sc.parallelize(\n IOUtils.toString(\n new URL(\"https://s3.amazonaws.com/apache-zeppelin/tutorial/bank/bank.csv\"),\n Charset.forName(\"utf8\")).split(\"\\n\"))\n\ncase class Bank(age: Integer, job: String, marital: String, education: String, balance: Integer)\n\nval bank = bankText.map(s => s.split(\";\")).filter(s => s(0) != \"\\\"age\\\"\").map(\n s => 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\")","dateUpdated":"2016-01-14T07:58:56+0000","config":{"colWidth":12,"graph":{"mode":"table","height":300,"optionOpen":false,"keys":[],"values":[],"groups":[],"scatter":{}},"title":true,"enabled":true,"editorMode":"ace/mode/scala"},"settings":{"params":{},"forms":{}},"jobName":"paragraph_1423500779206_-1502780787","id":"20150210-015259_1403135953","result":{"code":"SUCCESS","type":"TEXT","msg":"import org.apache.commons.io.IOUtils\nimport java.net.URL\nimport java.nio.charset.Charset\nbankText: org.apache.spark.rdd.RDD[String] = ParallelCollectionRDD[32] at parallelize at :65\ndefined class Bank\nbank: org.apache.spark.sql.DataFrame = [age: int, job: string, marital: string, education: string, balance: int]\n"},"dateCreated":"2015-02-10T01:52:59+0000","dateStarted":"2015-07-03T01:43:40+0000","dateFinished":"2015-07-03T01:43:45+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:188"},{"text":"%sql \nselect age, count(1) value\nfrom bank \nwhere age < 30 \ngroup by age \norder by age","config":{"colWidth":4,"graph":{"mode":"multiBarChart","height":300,"optionOpen":false,"keys":[{"name":"age","index":0,"aggr":"sum"}],"values":[{"name":"value","index":1,"aggr":"sum"}],"groups":[],"scatter":{"xAxis":{"name":"age","index":0,"aggr":"sum"},"yAxis":{"name":"value","index":1,"aggr":"sum"}}},"enabled":true,"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"jobName":"paragraph_1423500782552_-1439281894","id":"20150210-015302_1492795503","result":{"code":"SUCCESS","type":"TABLE","msg":"age\tvalue\n19\t4\n20\t3\n21\t7\n22\t9\n23\t20\n24\t24\n25\t44\n26\t77\n27\t94\n28\t103\n29\t97\n","comment":"","msgTable":[[{"key":"value","value":"19"},{"key":"value","value":"4"}],[{"value":"20"},{"value":"3"}],[{"value":"21"},{"value":"7"}],[{"value":"22"},{"value":"9"}],[{"value":"23"},{"value":"20"}],[{"value":"24"},{"value":"24"}],[{"value":"25"},{"value":"44"}],[{"value":"26"},{"value":"77"}],[{"value":"27"},{"value":"94"}],[{"value":"28"},{"value":"103"}],[{"value":"29"},{"value":"97"}]],"columnNames":[{"name":"age","index":0,"aggr":"sum"},{"name":"value","index":1,"aggr":"sum"}],"rows":[["19","4"],["20","3"],["21","7"],["22","9"],["23","20"],["24","24"],["25","44"],["26","77"],["27","94"],["28","103"],["29","97"]]},"dateCreated":"2015-02-10T01:53:02+0000","dateStarted":"2015-07-03T01:43:17+0000","dateFinished":"2015-07-03T01:43:23+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:189"},{"text":"%sql \nselect age, count(1) value \nfrom bank \nwhere age < ${maxAge=30} \ngroup by age \norder by age","config":{"colWidth":4,"graph":{"mode":"multiBarChart","height":300,"optionOpen":false,"keys":[{"name":"age","index":0,"aggr":"sum"}],"values":[{"name":"value","index":1,"aggr":"sum"}],"groups":[],"scatter":{"xAxis":{"name":"age","index":0,"aggr":"sum"},"yAxis":{"name":"value","index":1,"aggr":"sum"}}},"enabled":true,"editorMode":"ace/mode/sql"},"settings":{"params":{"maxAge":"35"},"forms":{"maxAge":{"name":"maxAge","defaultValue":"30","hidden":false}}},"jobName":"paragraph_1423720444030_-1424110477","id":"20150212-145404_867439529","result":{"code":"SUCCESS","type":"TABLE","msg":"age\tvalue\n19\t4\n20\t3\n21\t7\n22\t9\n23\t20\n24\t24\n25\t44\n26\t77\n27\t94\n28\t103\n29\t97\n30\t150\n31\t199\n32\t224\n33\t186\n34\t231\n","comment":"","msgTable":[[{"key":"value","value":"19"},{"key":"value","value":"4"}],[{"value":"20"},{"value":"3"}],[{"value":"21"},{"value":"7"}],[{"value":"22"},{"value":"9"}],[{"value":"23"},{"value":"20"}],[{"value":"24"},{"value":"24"}],[{"value":"25"},{"value":"44"}],[{"value":"26"},{"value":"77"}],[{"value":"27"},{"value":"94"}],[{"value":"28"},{"value":"103"}],[{"value":"29"},{"value":"97"}],[{"value":"30"},{"value":"150"}],[{"value":"31"},{"value":"199"}],[{"value":"32"},{"value":"224"}],[{"value":"33"},{"value":"186"}],[{"value":"34"},{"value":"231"}]],"columnNames":[{"name":"age","index":0,"aggr":"sum"},{"name":"value","index":1,"aggr":"sum"}],"rows":[["19","4"],["20","3"],["21","7"],["22","9"],["23","20"],["24","24"],["25","44"],["26","77"],["27","94"],["28","103"],["29","97"],["30","150"],["31","199"],["32","224"],["33","186"],["34","231"]]},"dateCreated":"2015-02-12T02:54:04+0000","dateStarted":"2015-07-03T01:43:28+0000","dateFinished":"2015-07-03T01:43:29+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:190"},{"text":"%sql \nselect age, count(1) value \nfrom bank \nwhere marital=\"${marital=single,single|divorced|married}\" \ngroup by age \norder by age","config":{"colWidth":4,"graph":{"mode":"multiBarChart","height":300,"optionOpen":false,"keys":[{"name":"age","index":0,"aggr":"sum"}],"values":[{"name":"value","index":1,"aggr":"sum"}],"groups":[],"scatter":{"xAxis":{"name":"age","index":0,"aggr":"sum"},"yAxis":{"name":"value","index":1,"aggr":"sum"}}},"enabled":true,"editorMode":"ace/mode/sql"},"settings":{"params":{"marital":"single"},"forms":{"marital":{"name":"marital","defaultValue":"single","options":[{"value":"single","$$hashKey":"object:872"},{"value":"divorced","$$hashKey":"object:873"},{"value":"married","$$hashKey":"object:874"}],"hidden":false}}},"jobName":"paragraph_1423836262027_-210588283","id":"20150213-230422_1600658137","result":{"code":"SUCCESS","type":"TABLE","msg":"age\tvalue\n19\t4\n20\t3\n21\t7\n22\t9\n23\t17\n24\t13\n25\t33\n26\t56\n27\t64\n28\t78\n29\t56\n30\t92\n31\t86\n32\t105\n33\t61\n34\t75\n35\t46\n36\t50\n37\t43\n38\t44\n39\t30\n40\t25\n41\t19\n42\t23\n43\t21\n44\t20\n45\t15\n46\t14\n47\t12\n48\t12\n49\t11\n50\t8\n51\t6\n52\t9\n53\t4\n55\t3\n56\t3\n57\t2\n58\t7\n59\t2\n60\t5\n66\t2\n69\t1\n","comment":"","msgTable":[[{"key":"value","value":"19"},{"key":"value","value":"4"}],[{"value":"20"},{"value":"3"}],[{"value":"21"},{"value":"7"}],[{"value":"22"},{"value":"9"}],[{"value":"23"},{"value":"17"}],[{"value":"24"},{"value":"13"}],[{"value":"25"},{"value":"33"}],[{"value":"26"},{"value":"56"}],[{"value":"27"},{"value":"64"}],[{"value":"28"},{"value":"78"}],[{"value":"29"},{"value":"56"}],[{"value":"30"},{"value":"92"}],[{"value":"31"},{"value":"86"}],[{"value":"32"},{"value":"105"}],[{"value":"33"},{"value":"61"}],[{"value":"34"},{"value":"75"}],[{"value":"35"},{"value":"46"}],[{"value":"36"},{"value":"50"}],[{"value":"37"},{"value":"43"}],[{"value":"38"},{"value":"44"}],[{"value":"39"},{"value":"30"}],[{"value":"40"},{"value":"25"}],[{"value":"41"},{"value":"19"}],[{"value":"42"},{"value":"23"}],[{"value":"43"},{"value":"21"}],[{"value":"44"},{"value":"20"}],[{"value":"45"},{"value":"15"}],[{"value":"46"},{"value":"14"}],[{"value":"47"},{"value":"12"}],[{"value":"48"},{"value":"12"}],[{"value":"49"},{"value":"11"}],[{"value":"50"},{"value":"8"}],[{"value":"51"},{"value":"6"}],[{"value":"52"},{"value":"9"}],[{"value":"53"},{"value":"4"}],[{"value":"55"},{"value":"3"}],[{"value":"56"},{"value":"3"}],[{"value":"57"},{"value":"2"}],[{"value":"58"},{"value":"7"}],[{"value":"59"},{"value":"2"}],[{"value":"60"},{"value":"5"}],[{"value":"66"},{"value":"2"}],[{"value":"69"},{"value":"1"}]],"columnNames":[{"name":"age","index":0,"aggr":"sum"},{"name":"value","index":1,"aggr":"sum"}],"rows":[["19","4"],["20","3"],["21","7"],["22","9"],["23","17"],["24","13"],["25","33"],["26","56"],["27","64"],["28","78"],["29","56"],["30","92"],["31","86"],["32","105"],["33","61"],["34","75"],["35","46"],["36","50"],["37","43"],["38","44"],["39","30"],["40","25"],["41","19"],["42","23"],["43","21"],["44","20"],["45","15"],["46","14"],["47","12"],["48","12"],["49","11"],["50","8"],["51","6"],["52","9"],["53","4"],["55","3"],["56","3"],["57","2"],["58","7"],["59","2"],["60","5"],["66","2"],["69","1"]]},"dateCreated":"2015-02-13T11:04:22+0000","dateStarted":"2015-07-03T01:43:33+0000","dateFinished":"2015-07-03T01:43:34+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:191"},{"text":"%md\n## Congratulations, it's done.\n##### You can create your own notebook in 'Notebook' menu. Good luck!","config":{"colWidth":12,"graph":{"mode":"table","height":300,"optionOpen":false,"keys":[],"values":[],"groups":[],"scatter":{}},"editorHide":true,"enabled":true,"editorMode":"ace/mode/markdown"},"settings":{"params":{},"forms":{}},"jobName":"paragraph_1423836268492_216498320","id":"20150213-230428_1231780373","result":{"code":"SUCCESS","type":"HTML","msg":"

Congratulations, it's done.

\n
You can create your own notebook in 'Notebook' menu. Good luck!
\n"},"dateCreated":"2015-02-13T11:04:28+0000","dateStarted":"2015-04-01T09:12:18+0000","dateFinished":"2015-04-01T09:12:18+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:192"},{"text":"%md\n\nAbout bank data\n\n```\nCitation Request:\n This dataset is public available for research. The details are described in [Moro et al., 2011]. \n Please include this citation if you plan to use this database:\n\n [Moro et al., 2011] S. Moro, R. Laureano and P. Cortez. Using Data Mining for Bank Direct Marketing: An Application of the CRISP-DM Methodology. \n In P. Novais et al. (Eds.), Proceedings of the European Simulation and Modelling Conference - ESM'2011, pp. 117-121, Guimarães, Portugal, October, 2011. EUROSIS.\n\n Available at: [pdf] http://hdl.handle.net/1822/14838\n [bib] http://www3.dsi.uminho.pt/pcortez/bib/2011-esm-1.txt\n```","config":{"colWidth":12,"graph":{"mode":"table","height":300,"optionOpen":false,"keys":[],"values":[],"groups":[],"scatter":{}},"editorHide":true,"enabled":true,"editorMode":"ace/mode/markdown"},"settings":{"params":{},"forms":{}},"jobName":"paragraph_1427420818407_872443482","id":"20150326-214658_12335843","result":{"code":"SUCCESS","type":"HTML","msg":"

About bank data

\n
Citation Request:\n  This dataset is public available for research. The details are described in [Moro et al., 2011]. \n  Please include this citation if you plan to use this database:\n\n  [Moro et al., 2011] S. Moro, R. Laureano and P. Cortez. Using Data Mining for Bank Direct Marketing: An Application of the CRISP-DM Methodology. \n  In P. Novais et al. (Eds.), Proceedings of the European Simulation and Modelling Conference - ESM'2011, pp. 117-121, Guimarães, Portugal, October, 2011. EUROSIS.\n\n  Available at: [pdf] http://hdl.handle.net/1822/14838\n                [bib] http://www3.dsi.uminho.pt/pcortez/bib/2011-esm-1.txt\n
\n"},"dateCreated":"2015-03-26T09:46:58+0000","dateStarted":"2015-07-03T01:44:56+0000","dateFinished":"2015-07-03T01:44:56+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:193"},{"config":{"colWidth":12,"graph":{"mode":"table","height":300,"optionOpen":false,"keys":[],"values":[],"groups":[],"scatter":{}},"enabled":true,"editorMode":"ace/mode/scala"},"settings":{"params":{},"forms":{}},"jobName":"paragraph_1435955447812_-158639899","id":"20150703-133047_853701097","dateCreated":"2015-07-03T01:30:47+0000","status":"READY","progressUpdateIntervalMs":500,"$$hashKey":"object:194"}],"name":"Getting Started / Zeppelin / Tutorial","id":"2A94M5J1Z","angularObjects":{},"config":{"looknfeel":"default"},"info":{}}