- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
hive creation of temp tables in default database during an INSERT?
- Labels:
-
Apache Hive
Created 03-20-2018 12:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have an INSERT statement, using the VALUES clause on a table that is formatted ORC and this table is not in the default database. When this INSERT attempts to run I get the following permissions error.
Caused by: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: HiveAccessControlException Permission denied: user [cdp8.admin] does not have [SELECT] privilege on [default/values__tmp__table__1/*]
Does my user [cdp8.admin] need the SELECT privilege on the default database even though I'm not using it?
Created 03-20-2018 01:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem seems to be around the default temporary table (at least, it is failing here before anything else). The query you make with the "VALUES" part work like this :
- it creates a temporary hive table with the line to be inserted
- it then queries that temporary table for inserting the data into the target table
From the output I see, the temporary table is created [default/values__tmp__table__1]. But the user does not have "select" permission on it.
I guess that a workaround would be to grant "SELECT" on the database "default" but this could bring some security issues for you (since the user will have read permission on all the tables inside "default").
Created 03-20-2018 01:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Any idea if the temporary table created with the line to be inserted has to in the "default" database? Is there a setting to modify this behavior in hive such that I can tell it to use a database the user does have access to?
Created 04-06-2021 02:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Michael,
In your insert query are you referring to table like "databasename.tablename"?, if yes, then first try to execute
"use databasename"
And then execute the query.