kgyrtkirk commented on code in PR #3247:
URL: https://github.com/apache/hive/pull/3247#discussion_r879312194
##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/misc/rename/AbstractAlterTableRenameAnalyzer.java:
##########
@@ -49,6 +55,13 @@ protected void analyzeCommand(TableName tableName,
Map<String, String> partition
setAcidDdlDesc(desc);
}
addInputsOutputsAlterTable(tableName, null, desc, desc.getType(), false);
+// inputs.add(new ReadEntity(table));
+ outputs.clear();
Review Comment:
doing `outputs.clear()` right after `addInputsOutputsAlterTable` is pretty
strange
could you please put this code into that method - isn't there where it
supposed to live?
##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/SQLAuthorizationUtils.java:
##########
@@ -271,7 +271,16 @@ private static boolean isOwner(IMetaStoreClient
metastoreClient, String userName
thriftTableObj = metastoreClient.getTable(hivePrivObject.getDbname(),
hivePrivObject.getObjectName());
} catch (Exception e) {
- throwGetObjErr(e, hivePrivObject);
+ boolean isTableExists = true;
+ try {
+ if(!metastoreClient.tableExists(hivePrivObject.getDbname(),
hivePrivObject.getObjectName())) {
Review Comment:
it would be better to place this check at the call site-s to this method -
so that the explanation will not be needed at all
##########
ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager2.java:
##########
@@ -3612,8 +3612,8 @@ private void testRenameTable(boolean blocking) throws
Exception {
txnMgr2.acquireLocks(driver2.getPlan(), ctx, null, false);
locks = getLocks();
- ShowLocksResponseElement checkLock = checkLock(LockType.EXCLUSIVE,
- LockState.WAITING, "default", "tab_acid", null, locks);
+ ShowLocksResponseElement checkLock = checkLock(LockType.SHARED_READ,
Review Comment:
Why we don't need an exclusive lock during a rename?
* what if we are reading data from a table in some dag
* in the meantime someone renames the table
with `SHARED_READ` the table will be renamed instantly - which will cause
the dag to fail; or not?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]