Spark兼容Hive入门解析

本文介绍了如何使用Spark兼容Hive进行开发,强调了需要在构建Spark时添加特定标志以包含Hive支持,并指出Hive的相关配置文件和库需要在所有worker节点上可用。此外,还分享了作者的本地实验过程,包括启动HDFS、Spark和MySQL,以及在Spark shell中创建和验证Hive表的操作,证明了Spark成功连接并操作了Hive数据。

最近使用spark兼容hive进行开发,所以静下心来简易的看了一遍。个人感觉有关与技术学习去官网是最正确的选择。所以我从官方网站入手开始讲,其他详细内容我不做过多介绍,这里直接开门见山。

官方网站有如下两点很重要:

Spark SQL also supports reading and writing data stored in Apache Hive. However, since Hive has a large number of dependencies, it is not included in the default Spark assembly. Hive support is enabled by adding the -Phive and -Phive-thriftserver flags to Spark’s build. This command builds a new assembly jar that includes Hive. Note that this Hive assembly jar must also be present on all of the worker nodes, as they will need access to the Hive serialization and deserialization libraries (SerDes) in order to access data stored in Hive.

spark sql同样可以支持读取并且写入到hive中数据。然而,由于hive拥有许多依赖,hive并没有被包含在默认的组件里面。hive插件可以通过增

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值