Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to get started with zeppelin

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

How to get started with zeppelin? in view of this question, this article introduces the corresponding analysis and answer in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

Display System

Text

Text content is output in Scala language by default

Shell

Html

Scala output html

Shell output html

Table

Scala

Shell

Table

Scala:

Shell:

Html:

Manual

Dynamic table

Use a form template

Text input format:

Use the formName template and use {formName=defaultValue} to provide default values

Drop-down selection form

${formName=defaultValue,option1 | option2... }

KMurv format, ${formName=defaultValue

Option1 (DisplayName) | option2 (DisplayName) … }

Dynamic programming

Z is a ZeppelinContext object

Text input format

Text input format with default values

Drop-down selection form

Notebook as Homepage

This part is not very heavy, just look at this link, 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

It's all about how to use it.

Tutorial with Local File

Data Refine

Download requires bank data, http://archive.ics.uci.edu/ml/machine-learning-databases/00222/bank.zip

First, convert the csv format data to the Bank object RDD, and filter the header column

Val bankText = sc.textFile ("/ home/cluster/data/test/bank/bank-full.csv") 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) / / Below line works only in spark 1.3.0.instead.bank.toDF / For spark 1.1.x and spark 1.2.x use bank.registerTempTable (" bank ") instead.bank.toDF () .registerTempTable (" bank ") 1234567891011121314151617

Data Retrieval

Suppose we want to see age distribution from bank. To do this, run:

Execute the following statement to see the distribution of age:

% sql select age, count (1) from bank where age

< 30 group by age order by age1 动态输入maxAge参数(默认是30岁): %sql select age, count(1) from bank where age < ${maxAge=30} group by age order by age1

View the age distribution based on the marital status options:

% sql select age, count (1) from bank where marital= "${marital=single,single | divorced | married}" group by age order by age1

Zeppelin works much like Spark's Thrift Server by submitting an application (Application) to Spark, and then each query corresponds to a stage.

Therefore, before starting Zeppelin, you can configure the soon-to-be-launched Spark driver by configuring the environment variable ZEPPELIN_JAVA_OPTS, such as "- Dspark.executor.memory=6g-Dspark.cores.max=32".

This is the answer to the question on how to get started with zeppelin. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report