difin commented on code in PR #6449:
URL: https://github.com/apache/hive/pull/6449#discussion_r3338346197
##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/view/create/CreateViewAnalyzer.java:
##########
@@ -191,6 +206,56 @@ private List<FieldSchema> getPartitionColumns(List<String>
partitionColumnNames)
return partitionColumnsCopy;
}
+ /**
+ * Returns the FQCN of the storage handler that should own external logical
view metadata, or {@code null} for a
+ * classic HMS virtual view. Uses {@code storageHandlerClassFromTableProps}
when non-null (from the
+ * {@code view-format} table property); otherwise the Hive config {@code
hive.default.storage.handler.class}.
+ */
+ private String resolveViewStorageHandlerClass(String
storageHandlerClassFromTableProps)
+ throws SemanticException {
+
+ String storageHandlerClassFromConfig =
+ StringUtils.trimToNull(HiveConf.getVar(conf,
HiveConf.ConfVars.HIVE_DEFAULT_STORAGE_HANDLER));
+
+ String storageHandlerClass =
+ storageHandlerClassFromTableProps != null ?
storageHandlerClassFromTableProps : storageHandlerClassFromConfig;
+
+ if (StringUtils.isBlank(storageHandlerClass)) {
+ return null;
+ }
+
+ boolean explicitViewFormat = storageHandlerClassFromTableProps != null;
+ try {
+ HiveStorageHandler storageHandler = HiveUtils.getStorageHandler(conf,
storageHandlerClass);
+
+ if (storageHandler != null &&
storageHandler.supportsExternalLogicalViewCatalog()) {
+ return storageHandlerClass;
+ }
+ } catch (HiveException e) {
+
+ if (explicitViewFormat) {
+ throw new
SemanticException(ErrorMsg.VIEW_STORAGE_HANDLER_UNSUPPORTED.format(storageHandlerClass),
e);
+ }
+ }
Review Comment:
Fixed
--
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]