大数据之spark(代码生成表权限问题)

  1. 模拟数据生成权限问题
    报错信息如下:

在这里插入图片描述
解决办法:
大数据之spark(代码生成表权限问题)_第1张图片
hdfs-site.xml中添加如下配置文件即可解决


  dfs.permissions
  false
  
    If "true", enable permission checking in HDFS.
    If "false", permission checking is turned off,
    but all other behavior is unchanged.
    Switching from one parameter value to the other does not change the mode,
    owner or group of files or directories.
  

或者直接在hive-site.xml 中直接添加如下即可

在这里插入图片描述

最后总结:
在windows的idea中访问linux下的hadoop会,报权限问题,原因是代码把windows账号做为hadoop账号提交过去了。

解决办法1:在执行程序的Edit Configurations中 做如下设置,把VM options中加入
-DHADOOP_USER_NAME=xxxxxx (你的hadoop用户)

大数据之spark(代码生成表权限问题)_第2张图片
大数据之spark(代码生成表权限问题)_第3张图片

解决办法2 在idea中的hive-site.xml中加入如下配置,可以跳过权限检测

dfs.permissions false

你可能感兴趣的:(大数据之spark(代码生成表权限问题))