[
https://issues.apache.org/jira/browse/HIVE-26055?focusedWorklogId=786602&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-786602
]
ASF GitHub Bot logged work on HIVE-26055:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 30/Jun/22 14:06
Start Date: 30/Jun/22 14:06
Worklog Time Spent: 10m
Work Description: deniskuzZ commented on code in PR #3247:
URL: https://github.com/apache/hive/pull/3247#discussion_r911066995
##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/misc/rename/AbstractAlterTableRenameAnalyzer.java:
##########
@@ -49,6 +55,11 @@ protected void analyzeCommand(TableName tableName,
Map<String, String> partition
setAcidDdlDesc(desc);
}
addInputsOutputsAlterTable(tableName, null, desc, desc.getType(), false);
+ String newDatabaseName = target.getDb() != null ? target.getDb() :
table.getDbName(); // extract new database name from new table name, if not
specified, then src dbname is used
+ Database newDatabase = getDatabase(newDatabaseName);
+ outputs.add(new WriteEntity(newDatabase,
WriteEntity.WriteType.DDL_SHARED));
+ Table newTable = new Table(target.getDb(), target.getTable());
Review Comment:
why not just call
````
DDLUtils.addDbAndTableToOutputs(
getDatabase(newDbName), newTable
table.getTableType(), table.isTemporary(), table.getParameters(),
outputs)`
````
##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/misc/rename/AbstractAlterTableRenameAnalyzer.java:
##########
@@ -49,6 +55,14 @@ protected void analyzeCommand(TableName tableName,
Map<String, String> partition
setAcidDdlDesc(desc);
}
addInputsOutputsAlterTable(tableName, null, desc, desc.getType(), false);
+ String newDatabaseName = target.getDb() != null ? target.getDb() :
table.getDbName(); // extract new database name from new table name, if not
specified, then src dbname is used
+ Database newDatabase = getDatabase(newDatabaseName);
+ outputs.add(new WriteEntity(newDatabase,
WriteEntity.WriteType.DDL_SHARED));
+ Table newTable = new Table(target.getDb(), target.getTable());
Review Comment:
should be
````
Table newTable = new Table(newDbName, target.getTable());
````
Issue Time Tracking
-------------------
Worklog Id: (was: 786602)
Time Spent: 5h 20m (was: 5h 10m)
> Fix the HivePrivilegesObjects for Alter table rename command
> ------------------------------------------------------------
>
> Key: HIVE-26055
> URL: https://issues.apache.org/jira/browse/HIVE-26055
> Project: Hive
> Issue Type: Bug
> Components: HiveServer2, Security
> Reporter: Sai Hemanth Gantasala
> Assignee: Sai Hemanth Gantasala
> Priority: Major
> Labels: pull-request-available
> Time Spent: 5h 20m
> Remaining Estimate: 0h
>
> Fix the HivePrivilegeObjects for Alter table rename query in a way that it
> includes source table information in the output objects and destination table
> information in the input objects.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)