Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2443,20 +2443,8 @@ public Optional<ConnectorViewDefinition> getView(ConnectorSession session, Schem
throw new HiveViewNotSupportedException(viewName);
}

ConnectorViewDefinition definition = createViewReader(metastore, session, view, typeManager, this::redirectTable, metadataProvider, hiveViewsRunAsInvoker)
return createViewReader(metastore, session, view, typeManager, this::redirectTable, metadataProvider, hiveViewsRunAsInvoker)
.decodeViewData(view.getViewOriginalText().get(), view, catalogName);
// use owner from table metadata if it exists
if (view.getOwner().isPresent() && !definition.isRunAsInvoker()) {
definition = new ConnectorViewDefinition(
definition.getOriginalSql(),
definition.getCatalog(),
definition.getSchema(),
definition.getColumns(),
definition.getComment(),
view.getOwner(),
false);
}
return definition;
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public ConnectorViewDefinition decodeViewData(String viewData, Table table, Cata
.map(column -> new ConnectorViewDefinition.ViewColumn(column.getName(), TypeId.of(column.getType().getTypeSignature().toString())))
.collect(toImmutableList()),
Optional.ofNullable(table.getParameters().get(TABLE_COMMENT)),
table.getOwner(),
hiveViewsRunAsInvoker ? Optional.empty() : table.getOwner(),
hiveViewsRunAsInvoker);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public ConnectorViewDefinition decodeViewData(String viewSql, Table table, Catal
Optional.of(table.getDatabaseName()),
columns,
Optional.ofNullable(table.getParameters().get(TABLE_COMMENT)),
Optional.empty(),
hiveViewsRunAsInvoker ? Optional.empty() : table.getOwner(),
hiveViewsRunAsInvoker);
}
catch (RuntimeException e) {
Expand Down