[jira] [Commented] (SENTRY-1646) Unable to truncate table .; from "default" databases
[ https://issues.apache.org/jira/browse/SENTRY-1646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16011563#comment-16011563 ] Hadoop QA commented on SENTRY-1646: --- Here are the results of testing the latest attachment https://issues.apache.org/jira/secure/attachment/12868179/SENTRY-1646.3.patch against master. {color:green}Overall:{color} +1 all checks pass {color:green}SUCCESS:{color} all tests passed Console output: https://builds.apache.org/job/PreCommit-SENTRY-Build/2713/console This message is automatically generated. > Unable to truncate table .; from "default" databases > - > > Key: SENTRY-1646 > URL: https://issues.apache.org/jira/browse/SENTRY-1646 > Project: Sentry > Issue Type: Bug > Components: Hive Plugin >Affects Versions: 1.7.0 >Reporter: Eric Lin >Assignee: Yongzhi Chen >Priority: Critical > Attachments: SENTRY-1646.1.patch, SENTRY-1646.2.patch, > SENTRY-1646.3.patch > > > When the user is doing truncate table .; from "default" > databases, it throws below error : > {code} > 0: jdbc:hive2://localhost:1/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=4) > {code} > It works if user does "use database;" and then runs truncate table: > {code} > 0: jdbc:hive2://localhost:1/default> use test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.128 seconds > INFO : Executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41): > use test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.014 seconds > INFO : OK > No rows affected (0.201 seconds) > 0: jdbc:hive2://localhost:1/default> truncate table test.test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.111 seconds > INFO : Executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1): > truncate table test.test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.046 seconds > INFO : OK > No rows affected (0.179 seconds) > 0: jdbc:hive2://localhost:1/default> > {code} > The workaround is to grant user permissions to the current data, then the > issue will go away. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SENTRY-1646) Unable to truncate table .; from "default" databases
[ https://issues.apache.org/jira/browse/SENTRY-1646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16011532#comment-16011532 ] Alexander Kolbasov commented on SENTRY-1646: [~ychena] Once the automatic tests pass I'll commit the patch for you. > Unable to truncate table .; from "default" databases > - > > Key: SENTRY-1646 > URL: https://issues.apache.org/jira/browse/SENTRY-1646 > Project: Sentry > Issue Type: Bug > Components: Hive Plugin >Affects Versions: 1.7.0 >Reporter: Eric Lin >Assignee: Yongzhi Chen >Priority: Critical > Attachments: SENTRY-1646.1.patch, SENTRY-1646.2.patch, > SENTRY-1646.3.patch > > > When the user is doing truncate table .; from "default" > databases, it throws below error : > {code} > 0: jdbc:hive2://localhost:1/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=4) > {code} > It works if user does "use database;" and then runs truncate table: > {code} > 0: jdbc:hive2://localhost:1/default> use test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.128 seconds > INFO : Executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41): > use test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.014 seconds > INFO : OK > No rows affected (0.201 seconds) > 0: jdbc:hive2://localhost:1/default> truncate table test.test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.111 seconds > INFO : Executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1): > truncate table test.test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.046 seconds > INFO : OK > No rows affected (0.179 seconds) > 0: jdbc:hive2://localhost:1/default> > {code} > The workaround is to grant user permissions to the current data, then the > issue will go away. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SENTRY-1646) Unable to truncate table .; from "default" databases
[ https://issues.apache.org/jira/browse/SENTRY-1646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16011468#comment-16011468 ] Sergio Peña commented on SENTRY-1646: - LGTM +1 > Unable to truncate table .; from "default" databases > - > > Key: SENTRY-1646 > URL: https://issues.apache.org/jira/browse/SENTRY-1646 > Project: Sentry > Issue Type: Bug > Components: Hive Plugin >Affects Versions: 1.7.0 >Reporter: Eric Lin >Assignee: Yongzhi Chen >Priority: Critical > Attachments: SENTRY-1646.1.patch, SENTRY-1646.2.patch, > SENTRY-1646.3.patch > > > When the user is doing truncate table .; from "default" > databases, it throws below error : > {code} > 0: jdbc:hive2://localhost:1/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=4) > {code} > It works if user does "use database;" and then runs truncate table: > {code} > 0: jdbc:hive2://localhost:1/default> use test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.128 seconds > INFO : Executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41): > use test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.014 seconds > INFO : OK > No rows affected (0.201 seconds) > 0: jdbc:hive2://localhost:1/default> truncate table test.test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.111 seconds > INFO : Executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1): > truncate table test.test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.046 seconds > INFO : OK > No rows affected (0.179 seconds) > 0: jdbc:hive2://localhost:1/default> > {code} > The workaround is to grant user permissions to the current data, then the > issue will go away. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SENTRY-1646) Unable to truncate table .; from "default" databases
[ https://issues.apache.org/jira/browse/SENTRY-1646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16011421#comment-16011421 ] Hao Hao commented on SENTRY-1646: - [~ychena] Overall it looks good to me. +1 with minor comments. Thanks! > Unable to truncate table .; from "default" databases > - > > Key: SENTRY-1646 > URL: https://issues.apache.org/jira/browse/SENTRY-1646 > Project: Sentry > Issue Type: Bug > Components: Hive Plugin >Affects Versions: 1.7.0 >Reporter: Eric Lin >Assignee: Yongzhi Chen >Priority: Critical > Attachments: SENTRY-1646.1.patch, SENTRY-1646.2.patch > > > When the user is doing truncate table .; from "default" > databases, it throws below error : > {code} > 0: jdbc:hive2://localhost:1/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=4) > {code} > It works if user does "use database;" and then runs truncate table: > {code} > 0: jdbc:hive2://localhost:1/default> use test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.128 seconds > INFO : Executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41): > use test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.014 seconds > INFO : OK > No rows affected (0.201 seconds) > 0: jdbc:hive2://localhost:1/default> truncate table test.test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.111 seconds > INFO : Executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1): > truncate table test.test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.046 seconds > INFO : OK > No rows affected (0.179 seconds) > 0: jdbc:hive2://localhost:1/default> > {code} > The workaround is to grant user permissions to the current data, then the > issue will go away. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SENTRY-1646) Unable to truncate table .; from "default" databases
[ https://issues.apache.org/jira/browse/SENTRY-1646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16011383#comment-16011383 ] Yongzhi Chen commented on SENTRY-1646: -- [~akolb], could you review the second patch? thanks > Unable to truncate table .; from "default" databases > - > > Key: SENTRY-1646 > URL: https://issues.apache.org/jira/browse/SENTRY-1646 > Project: Sentry > Issue Type: Bug > Components: Hive Plugin >Affects Versions: 1.7.0 >Reporter: Eric Lin >Assignee: Yongzhi Chen >Priority: Critical > Attachments: SENTRY-1646.1.patch, SENTRY-1646.2.patch > > > When the user is doing truncate table .; from "default" > databases, it throws below error : > {code} > 0: jdbc:hive2://localhost:1/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=4) > {code} > It works if user does "use database;" and then runs truncate table: > {code} > 0: jdbc:hive2://localhost:1/default> use test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.128 seconds > INFO : Executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41): > use test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.014 seconds > INFO : OK > No rows affected (0.201 seconds) > 0: jdbc:hive2://localhost:1/default> truncate table test.test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.111 seconds > INFO : Executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1): > truncate table test.test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.046 seconds > INFO : OK > No rows affected (0.179 seconds) > 0: jdbc:hive2://localhost:1/default> > {code} > The workaround is to grant user permissions to the current data, then the > issue will go away. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SENTRY-1646) Unable to truncate table .; from "default" databases
[ https://issues.apache.org/jira/browse/SENTRY-1646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15992978#comment-15992978 ] Yongzhi Chen commented on SENTRY-1646: -- [~hahao], could you review the second patch? Thanks > Unable to truncate table .; from "default" databases > - > > Key: SENTRY-1646 > URL: https://issues.apache.org/jira/browse/SENTRY-1646 > Project: Sentry > Issue Type: Bug > Components: Hive Plugin >Affects Versions: 1.7.0 >Reporter: Eric Lin >Assignee: Yongzhi Chen >Priority: Critical > Attachments: SENTRY-1646.1.patch, SENTRY-1646.2.patch > > > When the user is doing truncate table .; from "default" > databases, it throws below error : > {code} > 0: jdbc:hive2://localhost:1/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=4) > {code} > It works if user does "use database;" and then runs truncate table: > {code} > 0: jdbc:hive2://localhost:1/default> use test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.128 seconds > INFO : Executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41): > use test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.014 seconds > INFO : OK > No rows affected (0.201 seconds) > 0: jdbc:hive2://localhost:1/default> truncate table test.test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.111 seconds > INFO : Executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1): > truncate table test.test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.046 seconds > INFO : OK > No rows affected (0.179 seconds) > 0: jdbc:hive2://localhost:1/default> > {code} > The workaround is to grant user permissions to the current data, then the > issue will go away. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SENTRY-1646) Unable to truncate table .; from "default" databases
[ https://issues.apache.org/jira/browse/SENTRY-1646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15928336#comment-15928336 ] Hadoop QA commented on SENTRY-1646: --- Here are the results of testing the latest attachment https://issues.apache.org/jira/secure/attachment/12859109/SENTRY-1646.2.patch against master. {color:green}Overall:{color} +1 all checks pass {color:green}SUCCESS:{color} all tests passed Console output: https://builds.apache.org/job/PreCommit-SENTRY-Build/2445/console This message is automatically generated. > Unable to truncate table .; from "default" databases > - > > Key: SENTRY-1646 > URL: https://issues.apache.org/jira/browse/SENTRY-1646 > Project: Sentry > Issue Type: Bug > Components: Hive Plugin >Affects Versions: 1.7.0 >Reporter: Eric Lin >Assignee: Yongzhi Chen >Priority: Critical > Attachments: SENTRY-1646.1.patch, SENTRY-1646.2.patch > > > When the user is doing truncate table .; from "default" > databases, it throws below error : > {code} > 0: jdbc:hive2://localhost:1/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=4) > {code} > It works if user does "use database;" and then runs truncate table: > {code} > 0: jdbc:hive2://localhost:1/default> use test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.128 seconds > INFO : Executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41): > use test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.014 seconds > INFO : OK > No rows affected (0.201 seconds) > 0: jdbc:hive2://localhost:1/default> truncate table test.test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.111 seconds > INFO : Executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1): > truncate table test.test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.046 seconds > INFO : OK > No rows affected (0.179 seconds) > 0: jdbc:hive2://localhost:1/default> > {code} > The workaround is to grant user permissions to the current data, then the > issue will go away. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SENTRY-1646) Unable to truncate table .; from "default" databases
[ https://issues.apache.org/jira/browse/SENTRY-1646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15901367#comment-15901367 ] Yongzhi Chen commented on SENTRY-1646: -- Problem: When user put fully-qualified table name(for example db2.table1) in the truncate table statement, Sentry still get database name and table name from following statements (Sentry treates ast.getChild(0).getChild(0).getChildCount() > 1 the same as == 1): currOutDB = extractDatabase((ASTNode) ast.getChild(0)); currOutTab = extractTable((ASTNode) ast.getChild(0).getChild(0).getChild(0)); And later it uses the currOutDB + currOutTab to check the permission. But when the user is in the different db other than the table's db, for example default, the above statements will get curOutDB = default currOutTab = db2 Sentry use them to check permission, if the user does not have "all" permission on table default, he will get: 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=db2->action=*; (state=42000,code=4) You can see the Db and table names are all wrong in the error message. I fix it by getting the db and table name directly from ast node (the fully-qualified name). > Unable to truncate table .; from "default" databases > - > > Key: SENTRY-1646 > URL: https://issues.apache.org/jira/browse/SENTRY-1646 > Project: Sentry > Issue Type: Bug > Components: Hive Plugin >Affects Versions: 1.7.0 >Reporter: Eric Lin >Assignee: Yongzhi Chen >Priority: Critical > Attachments: SENTRY-1646.1.patch > > > When the user is doing truncate table .; from "default" > databases, it throws below error : > {code} > 0: jdbc:hive2://localhost:1/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=4) > {code} > It works if user does "use database;" and then runs truncate table: > {code} > 0: jdbc:hive2://localhost:1/default> use test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.128 seconds > INFO : Executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41): > use test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.014 seconds > INFO : OK > No rows affected (0.201 seconds) > 0: jdbc:hive2://localhost:1/default> truncate table test.test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.111 seconds > INFO : Executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1): > truncate table test.test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.046 seconds > INFO : OK > No rows affected (0.179 seconds) > 0: jdbc:hive2://localhost:1/default> > {code} > The workaround is to grant user permissions to the current data, then the > issue will go away. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SENTRY-1646) Unable to truncate table .; from "default" databases
[ https://issues.apache.org/jira/browse/SENTRY-1646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15899834#comment-15899834 ] Alexander Kolbasov commented on SENTRY-1646: Please describe what is the problem on the Sentry side and how are you fixing it. > Unable to truncate table .; from "default" databases > - > > Key: SENTRY-1646 > URL: https://issues.apache.org/jira/browse/SENTRY-1646 > Project: Sentry > Issue Type: Bug > Components: Hive Plugin >Affects Versions: 1.7.0 >Reporter: Eric Lin >Assignee: Yongzhi Chen >Priority: Critical > Attachments: SENTRY-1646.1.patch > > > When the user is doing truncate table .; from "default" > databases, it throws below error : > {code} > 0: jdbc:hive2://localhost:1/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=4) > {code} > It works if user does "use database;" and then runs truncate table: > {code} > 0: jdbc:hive2://localhost:1/default> use test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.128 seconds > INFO : Executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41): > use test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.014 seconds > INFO : OK > No rows affected (0.201 seconds) > 0: jdbc:hive2://localhost:1/default> truncate table test.test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.111 seconds > INFO : Executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1): > truncate table test.test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.046 seconds > INFO : OK > No rows affected (0.179 seconds) > 0: jdbc:hive2://localhost:1/default> > {code} > The workaround is to grant user permissions to the current data, then the > issue will go away. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SENTRY-1646) Unable to truncate table .; from "default" databases
[ https://issues.apache.org/jira/browse/SENTRY-1646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15899455#comment-15899455 ] Yongzhi Chen commented on SENTRY-1646: -- [~haohao], I add the review link. Thanks > Unable to truncate table .; from "default" databases > - > > Key: SENTRY-1646 > URL: https://issues.apache.org/jira/browse/SENTRY-1646 > Project: Sentry > Issue Type: Bug > Components: Hive Plugin >Affects Versions: 1.7.0 >Reporter: Eric Lin >Assignee: Yongzhi Chen >Priority: Critical > Attachments: SENTRY-1646.1.patch > > > When the user is doing truncate table .; from "default" > databases, it throws below error : > {code} > 0: jdbc:hive2://localhost:1/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=4) > {code} > It works if user does "use database;" and then runs truncate table: > {code} > 0: jdbc:hive2://localhost:1/default> use test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.128 seconds > INFO : Executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41): > use test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.014 seconds > INFO : OK > No rows affected (0.201 seconds) > 0: jdbc:hive2://localhost:1/default> truncate table test.test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.111 seconds > INFO : Executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1): > truncate table test.test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.046 seconds > INFO : OK > No rows affected (0.179 seconds) > 0: jdbc:hive2://localhost:1/default> > {code} > The workaround is to grant user permissions to the current data, then the > issue will go away. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SENTRY-1646) Unable to truncate table .; from "default" databases
[ https://issues.apache.org/jira/browse/SENTRY-1646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15898542#comment-15898542 ] Hadoop QA commented on SENTRY-1646: --- Here are the results of testing the latest attachment https://issues.apache.org/jira/secure/attachment/12856322/SENTRY-1646.1.patch against master. {color:green}Overall:{color} +1 all checks pass {color:green}SUCCESS:{color} all tests passed Console output: https://builds.apache.org/job/PreCommit-SENTRY-Build/2406/console This message is automatically generated. > Unable to truncate table .; from "default" databases > - > > Key: SENTRY-1646 > URL: https://issues.apache.org/jira/browse/SENTRY-1646 > Project: Sentry > Issue Type: Bug > Components: Hive Plugin >Affects Versions: 1.7.0 >Reporter: Eric Lin >Assignee: Yongzhi Chen >Priority: Critical > Attachments: SENTRY-1646.1.patch > > > When the user is doing truncate table .; from "default" > databases, it throws below error : > {code} > 0: jdbc:hive2://localhost:1/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=4) > {code} > It works if user does "use database;" and then runs truncate table: > {code} > 0: jdbc:hive2://localhost:1/default> use test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.128 seconds > INFO : Executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41): > use test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.014 seconds > INFO : OK > No rows affected (0.201 seconds) > 0: jdbc:hive2://localhost:1/default> truncate table test.test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.111 seconds > INFO : Executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1): > truncate table test.test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.046 seconds > INFO : OK > No rows affected (0.179 seconds) > 0: jdbc:hive2://localhost:1/default> > {code} > The workaround is to grant user permissions to the current data, then the > issue will go away. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SENTRY-1646) Unable to truncate table .; from "default" databases
[ https://issues.apache.org/jira/browse/SENTRY-1646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15898426#comment-15898426 ] Hao Hao commented on SENTRY-1646: - [~ychena] submitted it, would you mind to create a code review for it? Thanks! > Unable to truncate table .; from "default" databases > - > > Key: SENTRY-1646 > URL: https://issues.apache.org/jira/browse/SENTRY-1646 > Project: Sentry > Issue Type: Bug > Components: Hive Plugin >Affects Versions: 1.7.0 >Reporter: Eric Lin >Assignee: Yongzhi Chen >Priority: Critical > Attachments: SENTRY-1646.1.patch > > > When the user is doing truncate table .; from "default" > databases, it throws below error : > {code} > 0: jdbc:hive2://localhost:1/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=4) > {code} > It works if user does "use database;" and then runs truncate table: > {code} > 0: jdbc:hive2://localhost:1/default> use test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.128 seconds > INFO : Executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41): > use test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.014 seconds > INFO : OK > No rows affected (0.201 seconds) > 0: jdbc:hive2://localhost:1/default> truncate table test.test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.111 seconds > INFO : Executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1): > truncate table test.test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.046 seconds > INFO : OK > No rows affected (0.179 seconds) > 0: jdbc:hive2://localhost:1/default> > {code} > The workaround is to grant user permissions to the current data, then the > issue will go away. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SENTRY-1646) Unable to truncate table .; from "default" databases
[ https://issues.apache.org/jira/browse/SENTRY-1646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15897761#comment-15897761 ] Yongzhi Chen commented on SENTRY-1646: -- [~haohao], could you help me submit the patch for the pre-commit build and review it ? Thanks > Unable to truncate table .; from "default" databases > - > > Key: SENTRY-1646 > URL: https://issues.apache.org/jira/browse/SENTRY-1646 > Project: Sentry > Issue Type: Bug > Components: Hive Plugin >Affects Versions: 1.7.0 >Reporter: Eric Lin >Priority: Critical > Attachments: SENTRY-1646.1.patch > > > When the user is doing truncate table .; from "default" > databases, it throws below error : > {code} > 0: jdbc:hive2://localhost:1/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=4) > {code} > It works if user does "use database;" and then runs truncate table: > {code} > 0: jdbc:hive2://localhost:1/default> use test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.128 seconds > INFO : Executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41): > use test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_654cb0ff-6925-42a4-ba67-a151cd2e4f41); > Time taken: 0.014 seconds > INFO : OK > No rows affected (0.201 seconds) > 0: jdbc:hive2://localhost:1/default> truncate table test.test; > INFO : Compiling > command(queryId=hive_2017022814_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_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.111 seconds > INFO : Executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1): > truncate table test.test > INFO : Starting task [Stage-0:DDL] in serial mode > INFO : Completed executing > command(queryId=hive_2017022814_2441690e-7523-4525-aeb2-5105e31f51c1); > Time taken: 0.046 seconds > INFO : OK > No rows affected (0.179 seconds) > 0: jdbc:hive2://localhost:1/default> > {code} > The workaround is to grant user permissions to the current data, then the > issue will go away. -- This message was sent by Atlassian JIRA (v6.3.15#6346)