欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 手游 > spark关联hive 报 Filesystem Close 错误

spark关联hive 报 Filesystem Close 错误

2025/2/25 9:50:37 来源:https://blog.csdn.net/wozhendeyumenle/article/details/144347376  浏览:    关键词:spark关联hive 报 Filesystem Close 错误

请看如下问题:

假如我想将一个sql语句插入hive表中时,比如

insert into table tmp.app_user_active_range partition (dt='2022-11-04')

报如下错误:

我的环境是pyspark,pyspark中操作hive,使用datagrip关联spark,在datagrip中进行查询没有问题,但只要insert into 就报:FileSystem Close错误,如何处理呢?

假如遇到以上这个问题,就是hdfs有问题,可以在hdfs上添加一个配置:

以上这个问题常见于以下sql语句:

insert into table aaaa
select * from   bbbb
<property><name>fs.hdfs.impl.disable.cache</name><value>true</value>
</property>

记得分发给其他集群节点:

xsync.sh hdfs-site.xml

然后重启hdfs:

stop-dfs.sh start-dfs.sh

重启元数据:

hive-server-manager.sh stop metastore

然后重启thrift服务:

[root@bigdata01 sbin]# stop-thriftserver.sh stop
stopping org.apache.spark.sql.hive.thriftserver.HiveThriftServer2
(base) [root@bigdata01 sbin]# history | grep start-thrift634  /opt/installs/spark/sbin/start-thriftserver.sh --hiveconf hive.server2.thrift.port=10001 --hiveconf hive.server2.thrift.bind.host=bigdata01 --master yarn --conf spark.sql.shuffle.partitions=2

然后使用datagrip等第三方工具进行连接,再执行以前的sql就不抱错了。 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词