kgyrtkirk commented on a change in pull request #550: HIVE-21198 Introduce a
database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r260253836
##########
File path:
hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
##########
@@ -348,8 +348,8 @@ protected void
authorizeDDLWork(HiveSemanticAnalyzerHookContext cntxt, Hive hive
AlterTableDesc alterTable = work.getAlterTblDesc();
if (alterTable != null) {
- Table table = hive.getTable(SessionState.get().getCurrentDatabase(),
- Utilities.getDbTableName(alterTable.getOldName())[1], false);
+ final String tableName =
Utilities.getTableName(alterTable.getOldName()).getTable();
+ Table table = hive.getTable(SessionState.get().getCurrentDatabase(),
tableName, false);
Review comment:
`TableName` contains the database name;
`SessionState.get().getCurrentDatabase()` should appear only at the time of
creating the `TableName` - so as a sideeffect this "getTable()" will expect
`TableName` argument
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services