[jira] [Work logged] (HIVE-25545) Add/Drop constraints events on table should create authorizable events in HS2

2021-10-22 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25545?focusedWorklogId=669032&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-669032
 ]

ASF GitHub Bot logged work on HIVE-25545:
-

Author: ASF GitHub Bot
Created on: 22/Oct/21 16:27
Start Date: 22/Oct/21 16:27
Worklog Time Spent: 10m 
  Work Description: saihemanth-cloudera closed pull request #2665:
URL: https://github.com/apache/hive/pull/2665


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 669032)
Time Spent: 1.5h  (was: 1h 20m)

> Add/Drop constraints events on table should create authorizable events in HS2
> -
>
> Key: HIVE-25545
> URL: https://issues.apache.org/jira/browse/HIVE-25545
> Project: Hive
>  Issue Type: Bug
>  Components: HiveServer2
>Reporter: Sai Hemanth Gantasala
>Assignee: Sai Hemanth Gantasala
>Priority: Major
>  Labels: pull-request-available
> Fix For: 4.0.0
>
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Alter table foo_tbl ADD constraint c1_unique UNIQUE(id1) disable novalidate;
> Alter table foo_tbl DROP constraint c1_unique;
> The above statements are currently not being authorized in Ranger/Sentry. 
> These should be authorized by creating authorizable events in Hive.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-25545) Add/Drop constraints events on table should create authorizable events in HS2

2021-10-22 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25545?focusedWorklogId=669023&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-669023
 ]

ASF GitHub Bot logged work on HIVE-25545:
-

Author: ASF GitHub Bot
Created on: 22/Oct/21 16:18
Start Date: 22/Oct/21 16:18
Worklog Time Spent: 10m 
  Work Description: nrg4878 commented on pull request #2665:
URL: https://github.com/apache/hive/pull/2665#issuecomment-949775084


   Fix has been merged to master. Please close this PR as merged.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 669023)
Time Spent: 1h 20m  (was: 1h 10m)

> Add/Drop constraints events on table should create authorizable events in HS2
> -
>
> Key: HIVE-25545
> URL: https://issues.apache.org/jira/browse/HIVE-25545
> Project: Hive
>  Issue Type: Bug
>  Components: HiveServer2
>Reporter: Sai Hemanth Gantasala
>Assignee: Sai Hemanth Gantasala
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Alter table foo_tbl ADD constraint c1_unique UNIQUE(id1) disable novalidate;
> Alter table foo_tbl DROP constraint c1_unique;
> The above statements are currently not being authorized in Ranger/Sentry. 
> These should be authorized by creating authorizable events in Hive.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-25545) Add/Drop constraints events on table should create authorizable events in HS2

2021-09-29 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25545?focusedWorklogId=657967&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-657967
 ]

ASF GitHub Bot logged work on HIVE-25545:
-

Author: ASF GitHub Bot
Created on: 30/Sep/21 00:41
Start Date: 30/Sep/21 00:41
Worklog Time Spent: 10m 
  Work Description: saihemanth-cloudera commented on a change in pull 
request #2665:
URL: https://github.com/apache/hive/pull/2665#discussion_r718691636



##
File path: ql/src/test/queries/clientnegative/groupby_join_pushdown.q
##
@@ -22,45 +22,45 @@ FROM src f JOIN src g ON(f.key = g.key)
 GROUP BY f.key, g.key;
 
 EXPLAIN
-SELECT  f.ctinyint, g.ctinyint, SUM(f.cbigint)  
+SELECT  f.ctinyint, g.ctinyint, SUM(f.cbigint)

Review comment:
   Ack

##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/constraint/drop/AlterTableDropConstraintAnalyzer.java
##
@@ -47,11 +51,18 @@ protected void analyzeCommand(TableName tableName, 
Map partition
 String constraintName = unescapeIdentifier(command.getChild(0).getText());
 
 AlterTableDropConstraintDesc desc = new 
AlterTableDropConstraintDesc(tableName, null, constraintName);
-rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), 
desc)));
 
 Table table = getTable(tableName);
+WriteEntity.WriteType writeType = null;
 if (AcidUtils.isTransactionalTable(table)) {
   setAcidDdlDesc(desc);
+  writeType = WriteType.DDL_EXCLUSIVE;
+} else {
+  writeType = 
WriteEntity.determineAlterTableWriteType(AlterTableType.DROP_CONSTRAINT);
 }
+inputs.add(new ReadEntity(table));

Review comment:
   AlterTableDropConstraintDesc doesn't extend 
AbstractAlterTableWithConstraintsDesc as is the case with 
AlterTableAddConstraintDesc, So it cannot convert the descriptor object to add 
inputs and outputs. The reason why  AlterTableDropConstraintDesc cannot extend 
AbstractAlterTableWithConstraintsDesc is that the input command only issues the 
constraint name (ALTER TABLE foo DROP CONSTRAINT foo_constraint) but not the 
constraint object (which is the case with ADD constraint) and 
AbstractAlterTableWithConstraintsDesc takes constraint as an argument. 

##
File path: ql/src/test/results/clientnegative/groupby_join_pushdown.q.out
##
@@ -1358,249 +1358,15 @@ STAGE PLANS:
 
 PREHOOK: query: ALTER TABLE alltypesorc ADD CONSTRAINT pk_alltypesorc_1 
PRIMARY KEY (ctinyint) DISABLE RELY
 PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
-POSTHOOK: query: ALTER TABLE alltypesorc ADD CONSTRAINT pk_alltypesorc_1 
PRIMARY KEY (ctinyint) DISABLE RELY
-POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
-PREHOOK: query: explain
-SELECT sum(f.cint), f.ctinyint
-FROM alltypesorc f JOIN alltypesorc g ON(f.ctinyint = g.ctinyint)
-GROUP BY f.ctinyint, g.ctinyint
-PREHOOK: type: QUERY
-PREHOOK: Input: default@alltypesorc
- A masked pattern was here 
-POSTHOOK: query: explain
-SELECT sum(f.cint), f.ctinyint
-FROM alltypesorc f JOIN alltypesorc g ON(f.ctinyint = g.ctinyint)
-GROUP BY f.ctinyint, g.ctinyint
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@alltypesorc
- A masked pattern was here 
-STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-0 depends on stages: Stage-1
-
-STAGE PLANS:
-  Stage: Stage-1
-Tez
- A masked pattern was here 
-  Edges:
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 4 (SIMPLE_EDGE)
-Reducer 3 <- Reducer 2 (SIMPLE_EDGE)
- A masked pattern was here 
-  Vertices:
-Map 1 
-Map Operator Tree:
-TableScan
-  alias: f
-  Statistics: Num rows: 12288 Data size: 73392 Basic stats: 
COMPLETE Column stats: COMPLETE
-  Select Operator
-expressions: ctinyint (type: tinyint), cint (type: int)
-outputColumnNames: _col0, _col1
-Statistics: Num rows: 12288 Data size: 73392 Basic stats: 
COMPLETE Column stats: COMPLETE
-Reduce Output Operator
-  key expressions: _col0 (type: tinyint)
-  null sort order: z
-  sort order: +
-  Map-reduce partition columns: _col0 (type: tinyint)
-  Statistics: Num rows: 12288 Data size: 73392 Basic 
stats: COMPLETE Column stats: COMPLETE
-  value expressions: _col1 (type: int)
-Execution mode: vectorized, llap
-LLAP IO: all inputs
-Map 4 
-Map Operator Tree:
-TableScan
-  alias: g
-  Statistics: Num rows: 12288 Data size: 36696 Basic stats: 
COMPLETE Column stats: COMPLETE
-  Select Operator
-expressions: ctinyint (type: tinyint)
-outputColumnNam

[jira] [Work logged] (HIVE-25545) Add/Drop constraints events on table should create authorizable events in HS2

2021-09-29 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25545?focusedWorklogId=657394&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-657394
 ]

ASF GitHub Bot logged work on HIVE-25545:
-

Author: ASF GitHub Bot
Created on: 29/Sep/21 16:38
Start Date: 29/Sep/21 16:38
Worklog Time Spent: 10m 
  Work Description: saihemanth-cloudera commented on a change in pull 
request #2665:
URL: https://github.com/apache/hive/pull/2665#discussion_r718699524



##
File path: ql/src/test/results/clientnegative/groupby_join_pushdown.q.out
##
@@ -1358,249 +1358,15 @@ STAGE PLANS:
 
 PREHOOK: query: ALTER TABLE alltypesorc ADD CONSTRAINT pk_alltypesorc_1 
PRIMARY KEY (ctinyint) DISABLE RELY
 PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
-POSTHOOK: query: ALTER TABLE alltypesorc ADD CONSTRAINT pk_alltypesorc_1 
PRIMARY KEY (ctinyint) DISABLE RELY
-POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
-PREHOOK: query: explain
-SELECT sum(f.cint), f.ctinyint
-FROM alltypesorc f JOIN alltypesorc g ON(f.ctinyint = g.ctinyint)
-GROUP BY f.ctinyint, g.ctinyint
-PREHOOK: type: QUERY
-PREHOOK: Input: default@alltypesorc
- A masked pattern was here 
-POSTHOOK: query: explain
-SELECT sum(f.cint), f.ctinyint
-FROM alltypesorc f JOIN alltypesorc g ON(f.ctinyint = g.ctinyint)
-GROUP BY f.ctinyint, g.ctinyint
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@alltypesorc
- A masked pattern was here 
-STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-0 depends on stages: Stage-1
-
-STAGE PLANS:
-  Stage: Stage-1
-Tez
- A masked pattern was here 
-  Edges:
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 4 (SIMPLE_EDGE)
-Reducer 3 <- Reducer 2 (SIMPLE_EDGE)
- A masked pattern was here 
-  Vertices:
-Map 1 
-Map Operator Tree:
-TableScan
-  alias: f
-  Statistics: Num rows: 12288 Data size: 73392 Basic stats: 
COMPLETE Column stats: COMPLETE
-  Select Operator
-expressions: ctinyint (type: tinyint), cint (type: int)
-outputColumnNames: _col0, _col1
-Statistics: Num rows: 12288 Data size: 73392 Basic stats: 
COMPLETE Column stats: COMPLETE
-Reduce Output Operator
-  key expressions: _col0 (type: tinyint)
-  null sort order: z
-  sort order: +
-  Map-reduce partition columns: _col0 (type: tinyint)
-  Statistics: Num rows: 12288 Data size: 73392 Basic 
stats: COMPLETE Column stats: COMPLETE
-  value expressions: _col1 (type: int)
-Execution mode: vectorized, llap
-LLAP IO: all inputs
-Map 4 
-Map Operator Tree:
-TableScan
-  alias: g
-  Statistics: Num rows: 12288 Data size: 36696 Basic stats: 
COMPLETE Column stats: COMPLETE
-  Select Operator
-expressions: ctinyint (type: tinyint)
-outputColumnNames: _col0
-Statistics: Num rows: 12288 Data size: 36696 Basic stats: 
COMPLETE Column stats: COMPLETE
-Reduce Output Operator
-  key expressions: _col0 (type: tinyint)
-  null sort order: z
-  sort order: +
-  Map-reduce partition columns: _col0 (type: tinyint)
-  Statistics: Num rows: 12288 Data size: 36696 Basic 
stats: COMPLETE Column stats: COMPLETE
-Execution mode: vectorized, llap
-LLAP IO: all inputs
-Reducer 2 
-Execution mode: llap
-Reduce Operator Tree:
-  Merge Join Operator
-condition map:
- Inner Join 0 to 1
-keys:
-  0 _col0 (type: tinyint)
-  1 _col0 (type: tinyint)
-outputColumnNames: _col0, _col1
-Statistics: Num rows: 1161499 Data size: 9267080 Basic stats: 
COMPLETE Column stats: COMPLETE
-Group By Operator
-  aggregations: sum(_col1)
-  keys: _col0 (type: tinyint)
-  minReductionHashAggr: 0.99
-  mode: hash
-  outputColumnNames: _col0, _col1
-  Statistics: Num rows: 131 Data size: 1572 Basic stats: 
COMPLETE Column stats: COMPLETE
-  Reduce Output Operator
-key expressions: _col0 (type: tinyint)
-null sort order: z
-sort order: +
-Map-reduce partition columns: _col0 (type: tinyint)
-Statistics: Num rows: 131 Data size: 1572 Basic stats: 
COMPLETE Column stats: COMPLETE
-  

[jira] [Work logged] (HIVE-25545) Add/Drop constraints events on table should create authorizable events in HS2

2021-09-29 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25545?focusedWorklogId=657392&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-657392
 ]

ASF GitHub Bot logged work on HIVE-25545:
-

Author: ASF GitHub Bot
Created on: 29/Sep/21 16:37
Start Date: 29/Sep/21 16:37
Worklog Time Spent: 10m 
  Work Description: saihemanth-cloudera commented on a change in pull 
request #2665:
URL: https://github.com/apache/hive/pull/2665#discussion_r718698639



##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/constraint/drop/AlterTableDropConstraintAnalyzer.java
##
@@ -47,11 +51,18 @@ protected void analyzeCommand(TableName tableName, 
Map partition
 String constraintName = unescapeIdentifier(command.getChild(0).getText());
 
 AlterTableDropConstraintDesc desc = new 
AlterTableDropConstraintDesc(tableName, null, constraintName);
-rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), 
desc)));
 
 Table table = getTable(tableName);
+WriteEntity.WriteType writeType = null;
 if (AcidUtils.isTransactionalTable(table)) {
   setAcidDdlDesc(desc);
+  writeType = WriteType.DDL_EXCLUSIVE;
+} else {
+  writeType = 
WriteEntity.determineAlterTableWriteType(AlterTableType.DROP_CONSTRAINT);
 }
+inputs.add(new ReadEntity(table));

Review comment:
   AlterTableDropConstraintDesc doesn't extend 
AbstractAlterTableWithConstraintsDesc as is the case with 
AlterTableAddConstraintDesc, So it cannot convert the descriptor object to add 
inputs and outputs. The reason why  AlterTableDropConstraintDesc cannot extend 
AbstractAlterTableWithConstraintsDesc is that the input command only issues the 
constraint name (ALTER TABLE foo DROP CONSTRAINT foo_constraint) but not the 
constraint object (which is the case with ADD constraint) and 
AbstractAlterTableWithConstraintsDesc takes constraint as an argument. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 657392)
Time Spent: 50m  (was: 40m)

> Add/Drop constraints events on table should create authorizable events in HS2
> -
>
> Key: HIVE-25545
> URL: https://issues.apache.org/jira/browse/HIVE-25545
> Project: Hive
>  Issue Type: Bug
>  Components: HiveServer2
>Reporter: Sai Hemanth Gantasala
>Assignee: Sai Hemanth Gantasala
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> Alter table foo_tbl ADD constraint c1_unique UNIQUE(id1) disable novalidate;
> Alter table foo_tbl DROP constraint c1_unique;
> The above statements are currently not being authorized in Ranger/Sentry. 
> These should be authorized by creating authorizable events in Hive.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-25545) Add/Drop constraints events on table should create authorizable events in HS2

2021-09-29 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25545?focusedWorklogId=657378&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-657378
 ]

ASF GitHub Bot logged work on HIVE-25545:
-

Author: ASF GitHub Bot
Created on: 29/Sep/21 16:28
Start Date: 29/Sep/21 16:28
Worklog Time Spent: 10m 
  Work Description: saihemanth-cloudera commented on a change in pull 
request #2665:
URL: https://github.com/apache/hive/pull/2665#discussion_r718691636



##
File path: ql/src/test/queries/clientnegative/groupby_join_pushdown.q
##
@@ -22,45 +22,45 @@ FROM src f JOIN src g ON(f.key = g.key)
 GROUP BY f.key, g.key;
 
 EXPLAIN
-SELECT  f.ctinyint, g.ctinyint, SUM(f.cbigint)  
+SELECT  f.ctinyint, g.ctinyint, SUM(f.cbigint)

Review comment:
   Ack




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 657378)
Time Spent: 40m  (was: 0.5h)

> Add/Drop constraints events on table should create authorizable events in HS2
> -
>
> Key: HIVE-25545
> URL: https://issues.apache.org/jira/browse/HIVE-25545
> Project: Hive
>  Issue Type: Bug
>  Components: HiveServer2
>Reporter: Sai Hemanth Gantasala
>Assignee: Sai Hemanth Gantasala
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> Alter table foo_tbl ADD constraint c1_unique UNIQUE(id1) disable novalidate;
> Alter table foo_tbl DROP constraint c1_unique;
> The above statements are currently not being authorized in Ranger/Sentry. 
> These should be authorized by creating authorizable events in Hive.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-25545) Add/Drop constraints events on table should create authorizable events in HS2

2021-09-28 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25545?focusedWorklogId=656797&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-656797
 ]

ASF GitHub Bot logged work on HIVE-25545:
-

Author: ASF GitHub Bot
Created on: 28/Sep/21 20:20
Start Date: 28/Sep/21 20:20
Worklog Time Spent: 10m 
  Work Description: nrg4878 commented on a change in pull request #2665:
URL: https://github.com/apache/hive/pull/2665#discussion_r717176887



##
File path: ql/src/test/queries/clientnegative/groupby_join_pushdown.q
##
@@ -22,45 +22,45 @@ FROM src f JOIN src g ON(f.key = g.key)
 GROUP BY f.key, g.key;
 
 EXPLAIN
-SELECT  f.ctinyint, g.ctinyint, SUM(f.cbigint)  
+SELECT  f.ctinyint, g.ctinyint, SUM(f.cbigint)

Review comment:
   did you remove the spaces on purpose or a consequence of IDE? 

##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/constraint/drop/AlterTableDropConstraintAnalyzer.java
##
@@ -47,11 +51,18 @@ protected void analyzeCommand(TableName tableName, 
Map partition
 String constraintName = unescapeIdentifier(command.getChild(0).getText());
 
 AlterTableDropConstraintDesc desc = new 
AlterTableDropConstraintDesc(tableName, null, constraintName);
-rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), 
desc)));
 
 Table table = getTable(tableName);
+WriteEntity.WriteType writeType = null;
 if (AcidUtils.isTransactionalTable(table)) {
   setAcidDdlDesc(desc);
+  writeType = WriteType.DDL_EXCLUSIVE;
+} else {
+  writeType = 
WriteEntity.determineAlterTableWriteType(AlterTableType.DROP_CONSTRAINT);
 }
+inputs.add(new ReadEntity(table));

Review comment:
   can we not call addInputsOutputsAlterTable() like we did for ADD 
CONSTRAINT? It seems like all alter can use this method.

##
File path: ql/src/test/results/clientnegative/groupby_join_pushdown.q.out
##
@@ -1358,249 +1358,15 @@ STAGE PLANS:
 
 PREHOOK: query: ALTER TABLE alltypesorc ADD CONSTRAINT pk_alltypesorc_1 
PRIMARY KEY (ctinyint) DISABLE RELY
 PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
-POSTHOOK: query: ALTER TABLE alltypesorc ADD CONSTRAINT pk_alltypesorc_1 
PRIMARY KEY (ctinyint) DISABLE RELY
-POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
-PREHOOK: query: explain
-SELECT sum(f.cint), f.ctinyint
-FROM alltypesorc f JOIN alltypesorc g ON(f.ctinyint = g.ctinyint)
-GROUP BY f.ctinyint, g.ctinyint
-PREHOOK: type: QUERY
-PREHOOK: Input: default@alltypesorc
- A masked pattern was here 
-POSTHOOK: query: explain
-SELECT sum(f.cint), f.ctinyint
-FROM alltypesorc f JOIN alltypesorc g ON(f.ctinyint = g.ctinyint)
-GROUP BY f.ctinyint, g.ctinyint
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@alltypesorc
- A masked pattern was here 
-STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-0 depends on stages: Stage-1
-
-STAGE PLANS:
-  Stage: Stage-1
-Tez
- A masked pattern was here 
-  Edges:
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 4 (SIMPLE_EDGE)
-Reducer 3 <- Reducer 2 (SIMPLE_EDGE)
- A masked pattern was here 
-  Vertices:
-Map 1 
-Map Operator Tree:
-TableScan
-  alias: f
-  Statistics: Num rows: 12288 Data size: 73392 Basic stats: 
COMPLETE Column stats: COMPLETE
-  Select Operator
-expressions: ctinyint (type: tinyint), cint (type: int)
-outputColumnNames: _col0, _col1
-Statistics: Num rows: 12288 Data size: 73392 Basic stats: 
COMPLETE Column stats: COMPLETE
-Reduce Output Operator
-  key expressions: _col0 (type: tinyint)
-  null sort order: z
-  sort order: +
-  Map-reduce partition columns: _col0 (type: tinyint)
-  Statistics: Num rows: 12288 Data size: 73392 Basic 
stats: COMPLETE Column stats: COMPLETE
-  value expressions: _col1 (type: int)
-Execution mode: vectorized, llap
-LLAP IO: all inputs
-Map 4 
-Map Operator Tree:
-TableScan
-  alias: g
-  Statistics: Num rows: 12288 Data size: 36696 Basic stats: 
COMPLETE Column stats: COMPLETE
-  Select Operator
-expressions: ctinyint (type: tinyint)
-outputColumnNames: _col0
-Statistics: Num rows: 12288 Data size: 36696 Basic stats: 
COMPLETE Column stats: COMPLETE
-Reduce Output Operator
-  key expressions: _col0 (type: tinyint)
-  null sort order: z
-  sort order: +
-  Map-reduce partition columns: _col0 (type: tinyint)
-  

[jira] [Work logged] (HIVE-25545) Add/Drop constraints events on table should create authorizable events in HS2

2021-09-27 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25545?focusedWorklogId=655961&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-655961
 ]

ASF GitHub Bot logged work on HIVE-25545:
-

Author: ASF GitHub Bot
Created on: 28/Sep/21 03:31
Start Date: 28/Sep/21 03:31
Worklog Time Spent: 10m 
  Work Description: nrg4878 commented on a change in pull request #2665:
URL: https://github.com/apache/hive/pull/2665#discussion_r717176887



##
File path: ql/src/test/queries/clientnegative/groupby_join_pushdown.q
##
@@ -22,45 +22,45 @@ FROM src f JOIN src g ON(f.key = g.key)
 GROUP BY f.key, g.key;
 
 EXPLAIN
-SELECT  f.ctinyint, g.ctinyint, SUM(f.cbigint)  
+SELECT  f.ctinyint, g.ctinyint, SUM(f.cbigint)

Review comment:
   did you remove the spaces on purpose or a consequence of IDE? 

##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/constraint/drop/AlterTableDropConstraintAnalyzer.java
##
@@ -47,11 +51,18 @@ protected void analyzeCommand(TableName tableName, 
Map partition
 String constraintName = unescapeIdentifier(command.getChild(0).getText());
 
 AlterTableDropConstraintDesc desc = new 
AlterTableDropConstraintDesc(tableName, null, constraintName);
-rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), 
desc)));
 
 Table table = getTable(tableName);
+WriteEntity.WriteType writeType = null;
 if (AcidUtils.isTransactionalTable(table)) {
   setAcidDdlDesc(desc);
+  writeType = WriteType.DDL_EXCLUSIVE;
+} else {
+  writeType = 
WriteEntity.determineAlterTableWriteType(AlterTableType.DROP_CONSTRAINT);
 }
+inputs.add(new ReadEntity(table));

Review comment:
   can we not call addInputsOutputsAlterTable() like we did for ADD 
CONSTRAINT? It seems like all alter can use this method.

##
File path: ql/src/test/results/clientnegative/groupby_join_pushdown.q.out
##
@@ -1358,249 +1358,15 @@ STAGE PLANS:
 
 PREHOOK: query: ALTER TABLE alltypesorc ADD CONSTRAINT pk_alltypesorc_1 
PRIMARY KEY (ctinyint) DISABLE RELY
 PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
-POSTHOOK: query: ALTER TABLE alltypesorc ADD CONSTRAINT pk_alltypesorc_1 
PRIMARY KEY (ctinyint) DISABLE RELY
-POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
-PREHOOK: query: explain
-SELECT sum(f.cint), f.ctinyint
-FROM alltypesorc f JOIN alltypesorc g ON(f.ctinyint = g.ctinyint)
-GROUP BY f.ctinyint, g.ctinyint
-PREHOOK: type: QUERY
-PREHOOK: Input: default@alltypesorc
- A masked pattern was here 
-POSTHOOK: query: explain
-SELECT sum(f.cint), f.ctinyint
-FROM alltypesorc f JOIN alltypesorc g ON(f.ctinyint = g.ctinyint)
-GROUP BY f.ctinyint, g.ctinyint
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@alltypesorc
- A masked pattern was here 
-STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-0 depends on stages: Stage-1
-
-STAGE PLANS:
-  Stage: Stage-1
-Tez
- A masked pattern was here 
-  Edges:
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 4 (SIMPLE_EDGE)
-Reducer 3 <- Reducer 2 (SIMPLE_EDGE)
- A masked pattern was here 
-  Vertices:
-Map 1 
-Map Operator Tree:
-TableScan
-  alias: f
-  Statistics: Num rows: 12288 Data size: 73392 Basic stats: 
COMPLETE Column stats: COMPLETE
-  Select Operator
-expressions: ctinyint (type: tinyint), cint (type: int)
-outputColumnNames: _col0, _col1
-Statistics: Num rows: 12288 Data size: 73392 Basic stats: 
COMPLETE Column stats: COMPLETE
-Reduce Output Operator
-  key expressions: _col0 (type: tinyint)
-  null sort order: z
-  sort order: +
-  Map-reduce partition columns: _col0 (type: tinyint)
-  Statistics: Num rows: 12288 Data size: 73392 Basic 
stats: COMPLETE Column stats: COMPLETE
-  value expressions: _col1 (type: int)
-Execution mode: vectorized, llap
-LLAP IO: all inputs
-Map 4 
-Map Operator Tree:
-TableScan
-  alias: g
-  Statistics: Num rows: 12288 Data size: 36696 Basic stats: 
COMPLETE Column stats: COMPLETE
-  Select Operator
-expressions: ctinyint (type: tinyint)
-outputColumnNames: _col0
-Statistics: Num rows: 12288 Data size: 36696 Basic stats: 
COMPLETE Column stats: COMPLETE
-Reduce Output Operator
-  key expressions: _col0 (type: tinyint)
-  null sort order: z
-  sort order: +
-  Map-reduce partition columns: _col0 (type: tinyint)
-  

[jira] [Work logged] (HIVE-25545) Add/Drop constraints events on table should create authorizable events in HS2

2021-09-22 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25545?focusedWorklogId=654179&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-654179
 ]

ASF GitHub Bot logged work on HIVE-25545:
-

Author: ASF GitHub Bot
Created on: 22/Sep/21 17:19
Start Date: 22/Sep/21 17:19
Worklog Time Spent: 10m 
  Work Description: saihemanth-cloudera opened a new pull request #2665:
URL: https://github.com/apache/hive/pull/2665


   …zable events in HS2
   
   
   
   ### What changes were proposed in this pull request?
   Created authorizable events for ADD/DROP constraint events on alter table 
command. So that these events will be authorized in Apache Ranger/Sentry 
service.
   
   
   
   ### Why are the changes needed?
   So  that we can restrict any unauthorized user from doing these operations 
that can change the correctness of data.
   
   
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   
   
   ### How was this patch tested?
   Local machine, Remote cluster.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 654179)
Remaining Estimate: 0h
Time Spent: 10m

> Add/Drop constraints events on table should create authorizable events in HS2
> -
>
> Key: HIVE-25545
> URL: https://issues.apache.org/jira/browse/HIVE-25545
> Project: Hive
>  Issue Type: Bug
>  Components: HiveServer2
>Reporter: Sai Hemanth Gantasala
>Assignee: Sai Hemanth Gantasala
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Alter table foo_tbl ADD constraint c1_unique UNIQUE(id1) disable novalidate;
> Alter table foo_tbl DROP constraint c1_unique;
> The above statements are currently not being authorized in Ranger/Sentry. 
> These should be authorized by creating authorizable events in Hive.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)