zeppelin该如何入门使用
zeppelin該如何入門使用,針對這個(gè)問題,這篇文章詳細(xì)介紹了相對應(yīng)的分析和解答,希望可以幫助更多想解決這個(gè)問題的小伙伴找到更簡單易行的方法。
Display System
-
text
-
默認(rèn)使用scala語言輸出text內(nèi)容
-
shell
-
html
-
scala 輸出html
-
shell 輸出html
-
table
-
scala
-
shell
-
table
scala:
shell:
html:
Manual
-
動態(tài)表格
-
使用表格模板
文本輸入格式:
使用formName模板,使用{formName=defaultValue} 提供默認(rèn)值 -
下拉選擇表格
${formName=defaultValue,option1|option2…}
k-v格式,${formName=defaultValue,
option1(DisplayName)|option2(DisplayName)…} -
動態(tài)編程
z 是ZeppelinContext對象 -
文本輸入格式
-
帶默認(rèn)值的文本輸入格式
-
下拉選擇表格
-
Notebook as Homepage
這部分不是很重,直接看這個(gè)鏈接吧,http://zeppelin.incubator.apache.org/docs/manual/notebookashomepage.html
Interpreter
-
spark,http://zeppelin.incubator.apache.org/docs/interpreter/spark.html
-
hive
-
md
-
sh
-
flink
-
and so on
上面都有涉及,如何使用
Tutorial with Local File
-
Data Refine
下載需要bank數(shù)據(jù),http://archive.ics.uci.edu/ml/machine-learning-databases/00222/bank.zip
首先,將csv格式數(shù)據(jù)轉(zhuǎn)成Bank對象RDD,并過濾表頭列
valbankText=sc.textFile("/home/cluster/data/test/bank/bank-full.csv")
caseclassBank(age:Integer,job:String,marital:String,education:String,balance:Integer)
valbank=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
)
)
//Belowlineworksonlyinspark1.3.0.
//Forspark1.1.xandspark1.2.x,
//usebank.registerTempTable("bank")instead.
bank.toDF().registerTempTable("bank")1234567891011121314151617
-
Data Retrieval
Suppose we want to see age distribution from bank. To do this, run:
執(zhí)行以下語句,可看到年齡的分布:
%sqlselectage,count(1)frombankwhereage<30groupbyageorderbyage1
動態(tài)輸入maxAge參數(shù)(默認(rèn)是30歲):
%sqlselectage,count(1)frombankwhereage<${maxAge=30}groupbyageorderbyage1
根據(jù)婚姻狀況選項(xiàng),查看年齡分布狀況:
%sqlselectage,count(1)frombankwheremarital="${marital=single,single|divorced|married}"groupbyageorderbyage1
Zeppelin的工作方式和Spark的Thrift Server很像,都是向Spark提交一個(gè)應(yīng)用(Application),然后每一個(gè)查詢對應(yīng)一個(gè)stage。
因此,在啟動Zeppelin前,可以通過配置環(huán)境變量ZEPPELIN_JAVA_OPTS來對即將啟動的Spark driver進(jìn)行配置,例如“-Dspark.executor.memory=6g -Dspark.cores.max=32”。
總結(jié)
以上是生活随笔為你收集整理的zeppelin该如何入门使用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: status c语言_STM32 嵌入式
- 下一篇: mysql中如何求平均值