Skip to content

Commit

Permalink
add: 1.增加使用远程hive的使用说明
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyofin committed Jun 24, 2019
1 parent 5514052 commit cf2a6c9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ key-valuelist
* 使用hive元数据
* SparkSession spark = SparkSession.builder().enableHiveSupport().getOrCreate()

查询远程的hive
1. 项目中resource目录加入文件hive-site.xml,指明hive的thrift连接
```
<configuration>
<property>
<name>hive.metastore.uris</name>
<value>thrift://cdh01:9083</value>
</property>
</configuration>
2. 直接在代码中进行普通的spark sql查询即可
![](https://raw.githubusercontent.com/huzekang/picbed/master/20190624170353.png)
```
### 基本操作

```
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/hive-site.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<configuration>
<property>
<name>hive.metastore.uris</name>
<value>thrift://cdh01:9083</value>
</property>
</configuration>

0 comments on commit cf2a6c9

Please sign in to comment.