Skip to content

Instantly share code, notes, and snippets.

@yuikns
Created May 24, 2018 20:35
Show Gist options
  • Save yuikns/b7fc51a56e936e29f1577456c1b47563 to your computer and use it in GitHub Desktop.
Save yuikns/b7fc51a56e936e29f1577456c1b47563 to your computer and use it in GitHub Desktop.
{"paragraphs":[{"title":"Basic usage - Text note","text":"%md\n## Welcome to Zeppelin for CSE8803BDH.\n##### Try to follow this tutorial by yourself","dateUpdated":"Oct 9, 2016 4:29:49 AM","config":{"colWidth":12,"graph":{"mode":"table","height":300,"optionOpen":false,"keys":[],"values":[],"groups":[],"scatter":{}},"enabled":true,"title":true,"editorMode":"ace/mode/markdown","editorHide":true},"settings":{"params":{},"forms":{}},"jobName":"paragraph_1475985200667_166599436","id":"20161009-035320_276280784","result":{"code":"SUCCESS","type":"HTML","msg":"<h2>Welcome to Zeppelin for CSE8803BDH.</h2>\n<h5>Try to follow this tutorial by yourself</h5>\n"},"dateCreated":"Oct 9, 2016 3:53:20 AM","dateStarted":"Oct 9, 2016 4:29:49 AM","dateFinished":"Oct 9, 2016 4:29:49 AM","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:550"},{"text":"println(\"Hello World!\")","dateUpdated":"Oct 9, 2016 5:10:06 AM","config":{"colWidth":12,"graph":{"mode":"table","height":300,"optionOpen":false,"keys":[],"values":[],"groups":[],"scatter":{}},"enabled":true,"title":true,"editorMode":"ace/mode/scala","editorHide":false},"settings":{"params":{},"forms":{}},"jobName":"paragraph_1475986880113_1041679302","id":"20161009-042120_1256115069","result":{"code":"SUCCESS","type":"TEXT","msg":"Hello World!\n"},"dateCreated":"Oct 9, 2016 4:21:20 AM","dateStarted":"Oct 9, 2016 4:30:45 AM","dateFinished":"Oct 9, 2016 4:30:46 AM","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:551","title":"Basic Usage - scala code"},{"dateUpdated":"Oct 9, 2016 5:16:23 AM","config":{"colWidth":12,"graph":{"mode":"table","height":300,"optionOpen":false,"keys":[],"values":[],"groups":[],"scatter":{}},"enabled":true,"editorMode":"ace/mode/scala","title":true,"tableHide":true},"settings":{"params":{},"forms":{}},"jobName":"paragraph_1475987376619_1416926616","id":"20161009-042936_454239207","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[0] at parallelize at <console>:31\n\"age\";\"job\";\"marital\";\"education\";\"default\";\"balance\";\"housing\";\"loan\";\"contact\";\"day\";\"month\";\"duration\";\"campaign\";\"pdays\";\"previous\";\"poutcome\";\"y\"\n30;\"unemployed\";\"married\";\"primary\";\"no\";1787;\"no\";\"no\";\"cellular\";19;\"oct\";79;1;-1;0;\"unknown\";\"no\"\n33;\"services\";\"married\";\"secondary\";\"no\";4789;\"yes\";\"yes\";\"cellular\";11;\"may\";220;1;339;4;\"failure\";\"no\"\n35;\"management\";\"single\";\"tertiary\";\"no\";1350;\"yes\";\"no\";\"cellular\";16;\"apr\";185;1;330;1;\"failure\";\"no\"\n30;\"management\";\"married\";\"tertiary\";\"no\";1476;\"yes\";\"yes\";\"unknown\";3;\"jun\";199;4;-1;0;\"unknown\";\"no\"\n59;\"blue-collar\";\"married\";\"secondary\";\"no\";0;\"yes\";\"no\";\"unknown\";5;\"may\";226;1;-1;0;\"unknown\";\"no\"\n35;\"management\";\"single\";\"tertiary\";\"no\";747;\"no\";\"no\";\"cellular\";23;\"feb\";141;2;176;3;\"failure\";\"no\"\n36;\"self-employed\";\"married\";\"tertiary\";\"no\";307;\"yes\";\"no\";\"cellular\";14;\"may\";341;1;330;2;\"other\";\"no\"\n39;\"technician\";\"married\";\"secondary\";\"no\";147;\"yes\";\"no\";\"cellular\";6;\"may\";151;2;-1;0;\"unknown\";\"no\"\n41;\"entrepreneur\";\"married\";\"tertiary\";\"no\";221;\"yes\";\"no\";\"unknown\";14;\"may\";57;2;-1;0;\"unknown\";\"no\"\n"},"dateCreated":"Oct 9, 2016 4:29:36 AM","dateStarted":"Oct 9, 2016 5:08:26 AM","dateFinished":"Oct 9, 2016 5:08:33 AM","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:552","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\nbankText.take(10).foreach(println)","title":"Prepare data"},{"config":{"colWidth":12,"graph":{"mode":"table","height":300,"optionOpen":false,"keys":[],"values":[],"groups":[],"scatter":{}},"enabled":true,"title":true},"settings":{"params":{},"forms":{}},"jobName":"paragraph_1475989706817_2049411648","id":"20161009-050826_1869595236","dateCreated":"Oct 9, 2016 5:08:26 AM","status":"FINISHED","progressUpdateIntervalMs":500,"focus":true,"$$hashKey":"object:606","dateUpdated":"Oct 9, 2016 5:17:43 AM","dateFinished":"Oct 9, 2016 5:17:04 AM","dateStarted":"Oct 9, 2016 5:17:00 AM","title":"Load data into Table","result":{"code":"SUCCESS","type":"TEXT","msg":"defined class Bank\nbank: org.apache.spark.sql.DataFrame = [age: int, job: string, marital: string, education: string, balance: int]\n"},"text":"case 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\")"},{"config":{"colWidth":12,"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_1475990220510_-1064425786","id":"20161009-051700_1522014557","dateCreated":"Oct 9, 2016 5:17:00 AM","status":"FINISHED","progressUpdateIntervalMs":500,"focus":true,"$$hashKey":"object:647","dateUpdated":"Oct 9, 2016 5:51:57 AM","dateFinished":"Oct 9, 2016 5:25:41 AM","dateStarted":"Oct 9, 2016 5:25:25 AM","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"]]},"text":"%sql\nselect age, count(1) value\nfrom bank\nwhere age < 30\ngroup by age\norder by age"},{"config":{"colWidth":12,"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},"settings":{"params":{"maxAge":"40"},"forms":{"maxAge":{"name":"maxAge","defaultValue":"30","hidden":false}}},"jobName":"paragraph_1475990725651_1054124775","id":"20161009-052525_267965863","dateCreated":"Oct 9, 2016 5:25:25 AM","status":"FINISHED","progressUpdateIntervalMs":500,"focus":true,"$$hashKey":"object:671","dateUpdated":"Oct 9, 2016 6:02:03 AM","dateFinished":"Oct 9, 2016 6:02:06 AM","dateStarted":"Oct 9, 2016 6:02:03 AM","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\n35\t180\n36\t188\n37\t161\n38\t159\n39\t130\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"}],[{"value":"35"},{"value":"180"}],[{"value":"36"},{"value":"188"}],[{"value":"37"},{"value":"161"}],[{"value":"38"},{"value":"159"}],[{"value":"39"},{"value":"130"}]],"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"],["35","180"],["36","188"],["37","161"],["38","159"],["39","130"]]},"text":"%sql\nselect age, count(1) value\nfrom bank\nwhere age < ${maxAge=30}\ngroup by age\norder by age"},{"config":{"colWidth":12,"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},"settings":{"params":{"marital":"married"},"forms":{"marital":{"name":"marital","defaultValue":"single","options":[{"value":"single"},{"value":"divorced"},{"value":"married"}],"hidden":false}}},"jobName":"paragraph_1475993164098_-539981111","id":"20161009-060604_1687455318","dateCreated":"Oct 9, 2016 6:06:04 AM","status":"FINISHED","progressUpdateIntervalMs":500,"focus":true,"$$hashKey":"object:928","dateUpdated":"Oct 9, 2016 6:08:41 AM","dateFinished":"Oct 9, 2016 6:08:44 AM","dateStarted":"Oct 9, 2016 6:08:41 AM","result":{"code":"SUCCESS","type":"TABLE","msg":"age\tvalue\n23\t3\n24\t11\n25\t11\n26\t18\n27\t26\n28\t23\n29\t37\n30\t56\n31\t104\n32\t105\n33\t103\n34\t142\n35\t109\n36\t117\n37\t100\n38\t99\n39\t88\n40\t105\n41\t97\n42\t91\n43\t79\n44\t68\n45\t76\n46\t82\n47\t78\n48\t91\n49\t87\n50\t74\n51\t63\n52\t66\n53\t75\n54\t56\n55\t68\n56\t50\n57\t78\n58\t67\n59\t56\n60\t36\n61\t15\n62\t5\n63\t7\n64\t6\n65\t4\n66\t7\n67\t5\n68\t1\n69\t5\n70\t5\n71\t5\n72\t4\n73\t6\n74\t2\n75\t3\n76\t1\n77\t5\n78\t2\n79\t3\n80\t6\n81\t1\n83\t2\n86\t1\n87\t1\n","comment":"","msgTable":[[{"key":"value","value":"23"},{"key":"value","value":"3"}],[{"value":"24"},{"value":"11"}],[{"value":"25"},{"value":"11"}],[{"value":"26"},{"value":"18"}],[{"value":"27"},{"value":"26"}],[{"value":"28"},{"value":"23"}],[{"value":"29"},{"value":"37"}],[{"value":"30"},{"value":"56"}],[{"value":"31"},{"value":"104"}],[{"value":"32"},{"value":"105"}],[{"value":"33"},{"value":"103"}],[{"value":"34"},{"value":"142"}],[{"value":"35"},{"value":"109"}],[{"value":"36"},{"value":"117"}],[{"value":"37"},{"value":"100"}],[{"value":"38"},{"value":"99"}],[{"value":"39"},{"value":"88"}],[{"value":"40"},{"value":"105"}],[{"value":"41"},{"value":"97"}],[{"value":"42"},{"value":"91"}],[{"value":"43"},{"value":"79"}],[{"value":"44"},{"value":"68"}],[{"value":"45"},{"value":"76"}],[{"value":"46"},{"value":"82"}],[{"value":"47"},{"value":"78"}],[{"value":"48"},{"value":"91"}],[{"value":"49"},{"value":"87"}],[{"value":"50"},{"value":"74"}],[{"value":"51"},{"value":"63"}],[{"value":"52"},{"value":"66"}],[{"value":"53"},{"value":"75"}],[{"value":"54"},{"value":"56"}],[{"value":"55"},{"value":"68"}],[{"value":"56"},{"value":"50"}],[{"value":"57"},{"value":"78"}],[{"value":"58"},{"value":"67"}],[{"value":"59"},{"value":"56"}],[{"value":"60"},{"value":"36"}],[{"value":"61"},{"value":"15"}],[{"value":"62"},{"value":"5"}],[{"value":"63"},{"value":"7"}],[{"value":"64"},{"value":"6"}],[{"value":"65"},{"value":"4"}],[{"value":"66"},{"value":"7"}],[{"value":"67"},{"value":"5"}],[{"value":"68"},{"value":"1"}],[{"value":"69"},{"value":"5"}],[{"value":"70"},{"value":"5"}],[{"value":"71"},{"value":"5"}],[{"value":"72"},{"value":"4"}],[{"value":"73"},{"value":"6"}],[{"value":"74"},{"value":"2"}],[{"value":"75"},{"value":"3"}],[{"value":"76"},{"value":"1"}],[{"value":"77"},{"value":"5"}],[{"value":"78"},{"value":"2"}],[{"value":"79"},{"value":"3"}],[{"value":"80"},{"value":"6"}],[{"value":"81"},{"value":"1"}],[{"value":"83"},{"value":"2"}],[{"value":"86"},{"value":"1"}],[{"value":"87"},{"value":"1"}]],"columnNames":[{"name":"age","index":0,"aggr":"sum"},{"name":"value","index":1,"aggr":"sum"}],"rows":[["23","3"],["24","11"],["25","11"],["26","18"],["27","26"],["28","23"],["29","37"],["30","56"],["31","104"],["32","105"],["33","103"],["34","142"],["35","109"],["36","117"],["37","100"],["38","99"],["39","88"],["40","105"],["41","97"],["42","91"],["43","79"],["44","68"],["45","76"],["46","82"],["47","78"],["48","91"],["49","87"],["50","74"],["51","63"],["52","66"],["53","75"],["54","56"],["55","68"],["56","50"],["57","78"],["58","67"],["59","56"],["60","36"],["61","15"],["62","5"],["63","7"],["64","6"],["65","4"],["66","7"],["67","5"],["68","1"],["69","5"],["70","5"],["71","5"],["72","4"],["73","6"],["74","2"],["75","3"],["76","1"],["77","5"],["78","2"],["79","3"],["80","6"],["81","1"],["83","2"],["86","1"],["87","1"]]},"text":"%sql \nselect age, count(1) value \nfrom bank \nwhere marital=\"${marital=single,single|divorced|married}\" \ngroup by age \norder by age"},{"config":{"colWidth":12,"graph":{"mode":"table","height":300,"optionOpen":false,"keys":[],"values":[],"groups":[],"scatter":{}},"enabled":true},"settings":{"params":{},"forms":{}},"jobName":"paragraph_1475993237267_-1300321558","id":"20161009-060717_1135424415","dateCreated":"Oct 9, 2016 6:07:17 AM","status":"READY","progressUpdateIntervalMs":500,"focus":true,"$$hashKey":"object:974"}],"name":"tutorial","id":"2BY5G7X4X","angularObjects":{"2BXHY8UJA":[],"2BX3AG59X":[],"2BXD94H3T":[],"2BWCF9G33":[],"2BYAKGFE9":[]},"config":{"looknfeel":"default"},"info":{}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment