- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How delete files created in user directory with hive queries in a secured cluster [impersonation disabled]?
- Labels:
-
Apache Hive
Created 01-17-2018 07:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How delete files created in user directory with hive queries in the next case:
If I execute this query:
INSERT OVERWRITE DIRECTORY 'hdfs://hdp_cluster/user/my_user/output_folder' SELECT * FROM table_x
I'll have a folder (output_folder) with "hive" as owner (hive:hdfs). How can the final handle this?
Data: We have kerberos + ranger with hive impersonation disabled.
Created 01-17-2018 10:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have just validated, if you set hive.server2.enable.doas=true. The end directory(hdfs://hdp_cluster/user/my_user/output_folder) will be created with user name who ever is running that job.
Please check your Kerberos ticket for that user and proxy configurations. Hope this helps you.
Created 01-18-2018 08:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sridhar!
Impersonation in hive is disabled (you set hive.server2.enable.doas=false).
Created 01-19-2018 12:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Rodrigo Mendez what is the final result ? you need the files from user(s) directories to be removed ? Why do you want to perform this action from hive, you could easily do so by scripting (if you have multiple directories) from hdfs command.
Created 01-19-2018 01:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, it's easy for me as admin but I want to know if the same user that executes the query has a way to delete these files.