Problem description
-
- User Zhangsan executes insert overwrite:
INSERT OVERWRITE table temp.push_temp PARTITION(d_layer='app_video_uid_d_1')
SELECT ...
Could not be cleaned up:
Failed with exception Directory hdfs://Ucluster/user/hive/warehouse/temp.db/push_temp/d_layer=app_video_uid_d_1 could not be cleaned up.
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask. Directory hdfs://Ucluster/user/hive/warehouse/temp.db/push_temp/d_layer=app_video_uid_d_1 could not be cleaned up.
-
-
- check the HDFS directory permissions and find that the directory is writable by everyone, and the directory owner is Lisi:
-
drwxrwxrwt - lisi supergroup 0 2021-11-29 15:04 /user/hive/warehouse/temp.db/push_temp/d_layer=app_video_uid_d_1
-
-
-
- the user Lisi executes step 1. The SQL in step 1 can execute successfully
-
-
Cause of problem
Three words – viscous bit
look carefully at the directory permissions above. The last bit is “t”, which means that the sticky bit is enabled for the directory, that is, only the owner of the directory can delete files under the directory
# Non-owner delete sticky bit files
$ hadoop fs -rm /user/hive/warehouse/temp.db/push_temp/d_layer=app_video_uid_d_1/000000_0
21/11/29 16:32:59 INFO fs.TrashPolicyDefault: Namenode trash configuration: Deletion interval = 7320 minutes, Emptier interval = 0 minutes.
rm: Failed to move to trash: hdfs://Ucluster/user/hive/warehouse/temp.db/push_temp/d_layer=app_video_uid_d_1/000000_0: Permission denied by sticky bit setting: user=admin, inode=000000_0
Because insert overwrite needs to delete the original file in the directory, but it cannot be deleted due to sticky bits, resulting in HQL execution failure
Solution
Cancel the sticky bit of the directory
# Cancellation of sticking position
hadoop fs -chmod -R o-t /user/hive/warehouse/temp.db/push_temp/d_layer=app_video_uid_d_1
# Open sticking position
hadoop fs -chmod -R o+t /user/hive/warehouse/temp.db/push_temp/d_layer=app_video_uid_d_1
Read More:
- Appcompatactivity Error: WARNING: Local History will be also cleared.
- [Solved] waterdrop Import hive to clickhouse Error: Too many partitions for single INSERT block (more than 100).
- Hive Error: FAILED: RuntimeException Error loading hooks(hive.exec.post.hooks): java.lang.ClassNotFoundException: org.apache.atlas.hive.hook.HiveHook
- kernel module insert error: ERROR: could not insert module …../file.ko : File exits
- [Solved] Hive Error: FAILED: Execution Error, return code 3 from org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask
- Hive: Hive partition sorting error [How to Solve]
- [Solved] bin/hive Startup Error: Operation category READ is not supported in state standby
- PostgreSQL insert data error: column “XXX” does not exist solution
- [Solved] hive Caused by: MetaException(message:Version information not found in metastore. )
- [Local Precompilation Error] do not set execute permissions for source files
- [Solved] DPDK Error: insmod: ERROR: could not insert module igb_uio.ko: Invalid parameters
- Rendering Problems The following classes could not be instantiated: xml layout file could not be loaded
- [Solved] Hive Error while processing statement: FAILED: Execution Error
- [INS-06006] Passwordless SSH connectivity not set up [Solved]
- Hive 3.1.2 startup error reporting and resolution of guava version conflict
- [Solved] Hive Warehouse error: com.google.common.base.Preconditions.checkArgument
- Apache Altas Compile Error: [ERROR] Failed to execute goal on project atlas-testtools: Could not resolve
- [Solved] appium Original error: Could not proxy command to the remote server. Original error: socket hang up
- Initial installation of hive-2.1.0 startup error problem solution
- Huawei kafka Authentication error: Server not found in Kerberos database (7) – LOOKING_UP_SERVER