GitHub user Leemoonsoo opened a pull request:
https://github.com/apache/incubator-zeppelin/pull/140
ZEPPELIN-55 Make tutorial notebook independent from filesystem.
Tutorial notebook is downloading data using `wget` and unzip and load the
csv file.
This works only in local-mode and not going to work with cluster
deployments.
Discussed solution in the issue ZEPPELIN-55 are
* Upload data to HDFS
* Upload data to S3
However, not all user will install HDFS, and accessing S3 via hdfs client
needs accessKey and secretKey in configuration.
this PR make tutorial notebook independent from any filesystem, by reading
data from http(s) address and parallelize directly.
Here's how this PR loads data
```
// load bank data
val bankText = sc.parallelize(
IOUtils.toString(
new
URL("https://s3.amazonaws.com/apache-zeppelin/tutorial/bank/bank.csv"),
Charset.forName("utf8")).split("\n"))
case class Bank(age: Integer, job: String, marital: String, education:
String, balance: Integer)
val bank = bankText.map(s => s.split(";")).filter(s => s(0) !=
"\"age\"").map(
s => Bank(s(0).toInt,
s(1).replaceAll("\"", ""),
s(2).replaceAll("\"", ""),
s(3).replaceAll("\"", ""),
s(5).replaceAll("\"", "").toInt
)
).toDF()
bank.registerTempTable("bank")
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/Leemoonsoo/incubator-zeppelin ZEPPELIN-55
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-zeppelin/pull/140.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #140
----
commit 653b1bc47fee949fedfbd3bf5dfc3b77b1efd234
Author: Lee moon soo <[email protected]>
Date: 2015-07-03T20:46:35Z
Load data directly from http without using filesystem
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---