+
+## 二、Beeline
+
+### 2.1 HiveServer2
+
+HiveServer2(HS2)允许远程客户端可以使用各种编程语言向Hive提交请求并检索结果,支持多客户端并发访问和身份验证。HS2是由多个服务组成的单个进程,其包括基于Thrift的Hive服务(TCP或HTTP)和用于Web UI的Jetty Web服务器。
+
+ HiveServer2拥有自己的CLI(Beeline),Beeline是一个基于SQLLine的JDBC客户端,由于HiveServer2是Hive开发的重点,所以上面介绍的Hive CLI已经不推荐使用了,官方更加推荐使用Beeline。
+
+### 2.1 Beeline
+
+Beeline拥有更多可使用参数,可以使用`beeline --help` 查看,完整参数如下:
+
+```properties
+Usage: java org.apache.hive.cli.beeline.BeeLine
+ -u the JDBC URL to connect to
+ -r reconnect to last saved connect url (in conjunction with !save)
+ -n the username to connect as
+ -p the password to connect as
+ -d the driver class to use
+ -i script file for initialization
+ -e query that should be executed
+ -f script file that should be executed
+ -w (or) --password-file the password file to read password from
+ --hiveconf property=value Use value for given property
+ --hivevar name=value hive variable name and value
+ This is Hive specific settings in which variables
+ can be set at session level and referenced in Hive
+ commands or queries.
+ --property-file= the file to read connection properties (url, driver, user, password) from
+ --color=[true/false] control whether color is used for display
+ --showHeader=[true/false] show column names in query results
+ --headerInterval=ROWS; the interval between which heades are displayed
+ --fastConnect=[true/false] skip building table/column list for tab-completion
+ --autoCommit=[true/false] enable/disable automatic transaction commit
+ --verbose=[true/false] show verbose error messages and debug info
+ --showWarnings=[true/false] display connection warnings
+ --showNestedErrs=[true/false] display nested errors
+ --numberFormat=[pattern] format numbers using DecimalFormat pattern
+ --force=[true/false] continue running script even after errors
+ --maxWidth=MAXWIDTH the maximum width of the terminal
+ --maxColumnWidth=MAXCOLWIDTH the maximum width to use when displaying columns
+ --silent=[true/false] be more silent
+ --autosave=[true/false] automatically save preferences
+ --outputformat=[table/vertical/csv2/tsv2/dsv/csv/tsv] format mode for result display
+ --incrementalBufferRows=NUMROWS the number of rows to buffer when printing rows on stdout,
+ defaults to 1000; only applicable if --incremental=true
+ and --outputformat=table
+ --truncateTable=[true/false] truncate table column when it exceeds length
+ --delimiterForDSV=DELIMITER specify the delimiter for delimiter-separated values output format (default: |)
+ --isolation=LEVEL set the transaction isolation level
+ --nullemptystring=[true/false] set to true to get historic behavior of printing null as empty string
+ --maxHistoryRows=MAXHISTORYROWS The maximum number of rows to store beeline history.
+ --convertBinaryArrayToString=[true/false] display binary column data as string or as byte array
+ --help display this message
+
+```
+
+### 2.3 常用参数
+
+在Hive CLI中支持的参数,Beeline都支持,常用的参数如下。更多参数说明可以参见官方文档 [Beeline Command Options](https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-Beeline%E2%80%93NewCommandLineShell)
+
+| 参数 | 说明 |
+| -------------------------------------- | ------------------------------------------------------------ |
+| **-u \** | 数据库地址 |
+| **-n \** | 用户名 |
+| **-p \** | 密码 |
+| **-d \** | 驱动(可选) |
+| **-e \** | 执行SQL命令 |
+| **-f \** | 执行SQL脚本 |
+| **-i (or)--init \** | 在进入交互模式之前运行初始化脚本 |
+| **--property-file \** | 指定配置文件 |
+| **--hiveconf** *property**=**value* | 指定配置属性 |
+| **--hivevar** *name**=**value* | 用户自定义属性,在会话级别有效 |
+
+示例: 使用用户名和密码连接Hive
+
+```shell
+$ beeline -u jdbc:hive2://localhost:10000 -n username -p password
+```
+
+
+
+## 三、Hive配置
+
+可以通过三种方式对Hive的相关属性进行配置,分别介绍如下:
+
+### 3.1 配置文件
+
+方式一为使用配置文件,使用配置文件指定的配置是永久有效的。Hive有以下三个可选的配置文件:
+
++ hive-site.xml :Hive的主要配置文件;
+
++ hivemetastore-site.xml: 关于元数据的配置;
++ hiveserver2-site.xml:关于HiveServer2的配置。
+
+示例如下,在hive-site.xml配置`hive.exec.scratchdir`:
+
+```xml
+
+ hive.exec.scratchdir
+ /tmp/mydir
+ Scratch space for Hive jobs
+
+```
+
+### 3.2 hiveconf
+
+方式二为在启动命令行(Hive CLI / Beeline)的时候使用`--hiveconf`指定配置,这种方式指定的配置作用于整个Session。
+
+```
+hive --hiveconf hive.exec.scratchdir=/tmp/mydir
+```
+
+### 3.3 set
+
+方式三为在交互式环境下(Hive CLI / Beeline),使用set命令指定。这种设置的作用范围也是Session级别的,配置对于执行该命令后的所有命令生效。set兼具设置参数和查看参数的功能。如下:
+
+```shell
+0: jdbc:hive2://hadoop001:10000> set hive.exec.scratchdir=/tmp/mydir;
+No rows affected (0.025 seconds)
+0: jdbc:hive2://hadoop001:10000> set hive.exec.scratchdir;
++----------------------------------+--+
+| set |
++----------------------------------+--+
+| hive.exec.scratchdir=/tmp/mydir |
++----------------------------------+--+
+```
+
+### 3.4 配置优先级
+
+配置的优先顺序如下(后面的优先级更高):
+`hive-site.xml` - >` hivemetastore-site.xml `- > `hiveserver2-site.xml` - >` -- hiveconf`- > `set`
+
+### 3.5 配置参数
+
+Hive 可选的配置参数非常之多,这里就不一一罗列,在使用时查阅官方文档即可——[AdminManual Configuration](https://cwiki.apache.org/confluence/display/Hive/AdminManual+Configuration)。
+
+
+
+## 参考资料
+
+1. [HiveServer2 Clients](https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients)
+2. [LanguageManual Cli](https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Cli)
+3. [AdminManual Configuration](https://cwiki.apache.org/confluence/display/Hive/AdminManual+Configuration)
\ No newline at end of file
diff --git a/notes/HiveShell基本使用.md b/notes/HiveShell基本使用.md
deleted file mode 100644
index e69de29..0000000
diff --git a/pictures/hive-e.png b/pictures/hive-e.png
new file mode 100644
index 0000000..54a37f9
Binary files /dev/null and b/pictures/hive-e.png differ
diff --git a/pictures/hive-n-j.png b/pictures/hive-n-j.png
new file mode 100644
index 0000000..e376598
Binary files /dev/null and b/pictures/hive-n-j.png differ