MetaException(message:file:/user/hive/warehouse/xxx is not a directory or unable to create one)

版权声明:本文为博主原创文章,转载请注明出处。 https://blog.csdn.net/struggling_rong/article/details/82598012

环境:
hadoop 2.7.6 spark 2.2.0 hive 2.3.3
问题
编写spark应用保存数据到hive表,之前不存在该表,报如下错:

Caused by: MetaException(message:file:/user/hive/warehouse/t_spark_ncdc is not a directory or unable to create one)

原因
原因1: hdfs上对应存放表的目录没有相应的权限,,如/user/hive/warehouse/目录没有写的权限
原因2:保存数据到新表时没有指定数据库名,默认在default数据库下创建新表,spark应用无法在default数据库下创建新表。

猜你喜欢

转载自blog.csdn.net/struggling_rong/article/details/82598012
今日推荐