问题
当前采用python利用structstreaming写入hive table时,始终没有写入的权限,报错如下:
Caused by: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException):Permission denied : user=xxx, access="WRITE", inode="/":hdfs:supergroup:drwxr-xr-x
根据查询了解到,structstreaming持久化写入数据时,需要配置checkpointLocation参数,不然会写入默认路径:根目录下面,但是根目录没有写入权限,所以会报错;
以下是查询的结果:
This scenario is ideal for long-term persistence of output. Unlike memory and console sinks, files and directories are fault-tolerant. As such, this option requires a checkpoint directory, where state is maintained for fault-tolerance.
附上查询结果网址如下:https://databricks.com/blog/2017/04/04/real-time-end-to-end-integration-with-apache-kafka-in-apache-sparks-structured-streaming.html