nrg4878 commented on a change in pull request #2191:
URL: https://github.com/apache/hive/pull/2191#discussion_r636924592
##########
File path: ql/src/test/results/clientnegative/translated_external_rename.q.out
##########
@@ -0,0 +1,22 @@
+PREHOOK: query: create external table t (a integer)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@t
+POSTHOOK: query: create external table t (a integer)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@t
+PREHOOK: query: insert into t values(1)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@t
+POSTHOOK: query: insert into t values(1)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@t
+POSTHOOK: Lineage: t.a SCRIPT []
+PREHOOK: query: alter table t rename to t2
+PREHOOK: type: ALTERTABLE_RENAME
+PREHOOK: Input: default@t
+PREHOOK: Output: default@t
+FAILED: Execution Error, return code 40013 from
org.apache.hadoop.hive.ql.ddl.DDLTask. Unable to alter table.
java.lang.NullPointerException
Review comment:
nit: Looks like the exception is NullPointerException. Not a showstopper
but I would expect this to be a MetaException
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetastoreDefaultTransformer.java
##########
@@ -822,7 +934,7 @@ private Table validateTablePaths(Table table) throws
MetaException {
+ table.getTableName() + ",location:" + tablePath +
",Database's managed warehouse:" + dbLocation);
}
} else {
- if (FileUtils.isSubdirectory(whRootPath.toString(),
tablePath.toString())) {
+ if (isExternalWarehouseSet() &&
FileUtils.isSubdirectory(whRootPath.toString(), tablePath.toString())) {
Review comment:
So we only care that an external table is outside the managed warehouse
root. It does not have to be within the external warehouse. So even if external
warehouse isnt set, we shouldnt have to reject a path so long as it is not in
the managed warehouse root.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]