Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
1.7.0, 1.8.0, 2.0.0
-
None
Description
When the user is doing truncate table <database>.<tablename>; from "default" databases, it throws below error :
0: jdbc:hive2://localhost:10000/default> truncate table test.test; Error: Error while compiling statement: FAILED: SemanticException No valid privileges User user1 does not have privileges for TRUNCATETABLE The required privileges: Server=server1->Db=default->Table=test->action=*; (state=42000,code=40000)
It works if user does "use database;" and then runs truncate table:
0: jdbc:hive2://localhost:10000/default> use test; INFO : Compiling command(queryId=hive_20170228141111_654cb0ff-6925-42a4-ba67-a151cd2e4f41): use test INFO : Semantic Analysis Completed INFO : Returning Hive schema: Schema(fieldSchemas:null, properties:null) INFO : Completed compiling command(queryId=hive_20170228141111_654cb0ff-6925-42a4-ba67-a151cd2e4f41); Time taken: 0.128 seconds INFO : Executing command(queryId=hive_20170228141111_654cb0ff-6925-42a4-ba67-a151cd2e4f41): use test INFO : Starting task [Stage-0:DDL] in serial mode INFO : Completed executing command(queryId=hive_20170228141111_654cb0ff-6925-42a4-ba67-a151cd2e4f41); Time taken: 0.014 seconds INFO : OK No rows affected (0.201 seconds) 0: jdbc:hive2://localhost:10000/default> truncate table test.test; INFO : Compiling command(queryId=hive_20170228141111_2441690e-7523-4525-aeb2-5105e31f51c1): truncate table test.test INFO : Semantic Analysis Completed INFO : Returning Hive schema: Schema(fieldSchemas:null, properties:null) INFO : Completed compiling command(queryId=hive_20170228141111_2441690e-7523-4525-aeb2-5105e31f51c1); Time taken: 0.111 seconds INFO : Executing command(queryId=hive_20170228141111_2441690e-7523-4525-aeb2-5105e31f51c1): truncate table test.test INFO : Starting task [Stage-0:DDL] in serial mode INFO : Completed executing command(queryId=hive_20170228141111_2441690e-7523-4525-aeb2-5105e31f51c1); Time taken: 0.046 seconds INFO : OK No rows affected (0.179 seconds) 0: jdbc:hive2://localhost:10000/default>
The workaround is to grant user permissions to the current data, then the issue will go away.
Attachments
Attachments
Issue Links
- is duplicated by
-
SENTRY-1465 truncate table is not working with qualified table names from beeline
- Open
- links to