Skip to content
Merged
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 @@ -175,6 +175,7 @@ public class TrinoGlueCatalog
private final AWSGlueAsync glueClient;
private final GlueMetastoreStats stats;
private final boolean hideMaterializedViewStorageTable;
private final boolean isUsingSystemSecurity;

private final Cache<SchemaTableName, com.amazonaws.services.glue.model.Table> glueTableCache = EvictableCacheBuilder.newBuilder()
// Even though this is query-scoped, this still needs to be bounded. information_schema queries can access large number of tables.
Expand All @@ -193,6 +194,7 @@ public TrinoGlueCatalog(
String trinoVersion,
AWSGlueAsync glueClient,
GlueMetastoreStats stats,
boolean isUsingSystemSecurity,
Optional<String> defaultSchemaLocation,
boolean useUniqueTableLocation,
boolean hideMaterializedViewStorageTable)
Expand All @@ -204,6 +206,7 @@ public TrinoGlueCatalog(
this.fileSystemFactory = requireNonNull(fileSystemFactory, "fileSystemFactory is null");
this.glueClient = requireNonNull(glueClient, "glueClient is null");
this.stats = requireNonNull(stats, "stats is null");
this.isUsingSystemSecurity = isUsingSystemSecurity;
this.defaultSchemaLocation = requireNonNull(defaultSchemaLocation, "defaultSchemaLocation is null");
this.hideMaterializedViewStorageTable = hideMaterializedViewStorageTable;
}
Expand Down Expand Up @@ -1180,7 +1183,7 @@ private void createMaterializedViewWithStorageTable(
TableInput materializedViewTableInput = getMaterializedViewTableInput(
viewName.getTableName(),
encodeMaterializedViewData(fromConnectorMaterializedViewDefinition(definition)),
session.getUser(),
isUsingSystemSecurity ? null : session.getUser(),
createMaterializedViewProperties(session, storageTable));

if (existing.isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io.trino.plugin.hive.metastore.glue.GlueHiveMetastoreConfig;
import io.trino.plugin.hive.metastore.glue.GlueMetastoreStats;
import io.trino.plugin.iceberg.IcebergConfig;
import io.trino.plugin.iceberg.IcebergSecurityConfig;
import io.trino.plugin.iceberg.catalog.IcebergTableOperationsProvider;
import io.trino.plugin.iceberg.catalog.TrinoCatalog;
import io.trino.plugin.iceberg.catalog.TrinoCatalogFactory;
Expand All @@ -31,6 +32,7 @@

import java.util.Optional;

import static io.trino.plugin.iceberg.IcebergSecurityConfig.IcebergSecurity.SYSTEM;
import static java.util.Objects.requireNonNull;

public class TrinoGlueCatalogFactory
Expand All @@ -47,6 +49,7 @@ public class TrinoGlueCatalogFactory
private final boolean isUniqueTableLocation;
private final boolean hideMaterializedViewStorageTable;
private final GlueMetastoreStats stats;
private final boolean isUsingSystemSecurity;

@Inject
public TrinoGlueCatalogFactory(
Expand All @@ -58,6 +61,7 @@ public TrinoGlueCatalogFactory(
GlueHiveMetastoreConfig glueConfig,
IcebergConfig icebergConfig,
IcebergGlueCatalogConfig catalogConfig,
IcebergSecurityConfig securityConfig,
GlueMetastoreStats stats,
AWSGlueAsync glueClient)
{
Expand All @@ -72,6 +76,7 @@ public TrinoGlueCatalogFactory(
this.isUniqueTableLocation = icebergConfig.isUniqueTableLocation();
this.hideMaterializedViewStorageTable = icebergConfig.isHideMaterializedViewStorageTable();
this.stats = requireNonNull(stats, "stats is null");
this.isUsingSystemSecurity = securityConfig.getSecuritySystem() == SYSTEM;
}

@Managed
Expand All @@ -93,6 +98,7 @@ public TrinoCatalog create(ConnectorIdentity identity)
trinoVersion,
glueClient,
stats,
isUsingSystemSecurity,
defaultSchemaLocation,
isUniqueTableLocation,
hideMaterializedViewStorageTable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ protected TrinoCatalog createTrinoCatalog(boolean useUniqueTableLocations)
"test",
glueClient,
new GlueMetastoreStats(),
false,
Optional.empty(),
useUniqueTableLocations,
new IcebergConfig().isHideMaterializedViewStorageTable());
Expand Down Expand Up @@ -158,6 +159,7 @@ public void testDefaultLocation()
"test",
glueClient,
new GlueMetastoreStats(),
false,
Optional.of(tmpDirectory.toAbsolutePath().toString()),
false,
new IcebergConfig().isHideMaterializedViewStorageTable());
Expand Down