public CatalogSchemaTableName asCatalogSchemaTableName() { return new CatalogSchemaTableName(catalogName, schemaName, objectName); }
/** * Check if identity is allowed to rename the specified table in a catalog. * * @throws AccessDeniedException if not allowed */ default void checkCanRenameTable(Identity identity, CatalogSchemaTableName table, CatalogSchemaTableName newTable) { denyRenameTable(table.toString(), newTable.toString()); }
@Override public void checkCanSelectFromColumns(Identity identity, CatalogSchemaTableName table, Set<String> columns) { if (table.getCatalogName().equals("secured_catalog")) { denySelectTable(table.toString()); } }
@Override public void checkCanSelectFromColumns(Identity identity, CatalogSchemaTableName table, Set<String> columns) { if (table.getCatalogName().equals("secured_catalog")) { denySelectTable(table.toString()); } }
public CatalogSchemaTableName asCatalogSchemaTableName() { return new CatalogSchemaTableName(catalogName, schemaName, objectName); }
/** * Check if identity is allowed to drop the specified table in a catalog. * * @throws AccessDeniedException if not allowed */ default void checkCanDropTable(Identity identity, CatalogSchemaTableName table) { denyDropTable(table.toString()); }
@Override public Void visitTableScan(TableScanNode node, IOPlanBuilder context) { TableMetadata tableMetadata = metadata.getTableMetadata(session, node.getTable()); context.addInputTableColumnInfo(new IOPlan.TableColumnInfo( new CatalogSchemaTableName( tableMetadata.getConnectorId().getCatalogName(), tableMetadata.getTable().getSchemaName(), tableMetadata.getTable().getTableName()), parseConstraints(node.getTable(), node.getCurrentConstraint()))); return null; }
/** * Check if identity is allowed to select from the specified columns in a relation. The column set can be empty. * * @throws AccessDeniedException if not allowed */ default void checkCanSelectFromColumns(Identity identity, CatalogSchemaTableName table, Set<String> columns) { denySelectColumns(table.toString(), columns); }
@Override public Void visitTableScan(TableScanNode node, IoPlanBuilder context) { TableMetadata tableMetadata = metadata.getTableMetadata(session, node.getTable()); context.addInputTableColumnInfo(new IoPlan.TableColumnInfo( new CatalogSchemaTableName( tableMetadata.getConnectorId().getCatalogName(), tableMetadata.getTable().getSchemaName(), tableMetadata.getTable().getTableName()), parseConstraints(node.getTable(), node.getCurrentConstraint()))); return null; }
/** * Check if identity is allowed to rename a column in the specified table in a catalog. * * @throws AccessDeniedException if not allowed */ default void checkCanRenameColumn(Identity identity, CatalogSchemaTableName table) { denyRenameColumn(table.toString()); }
if (writerTarget instanceof CreateHandle) { CreateHandle createHandle = (CreateHandle) writerTarget; context.setOutputTable(new CatalogSchemaTableName( createHandle.getHandle().getConnectorId().getCatalogName(), createHandle.getSchemaTableName().getSchemaName(), context.setOutputTable(new CatalogSchemaTableName( insertHandle.getHandle().getConnectorId().getCatalogName(), insertHandle.getSchemaTableName().getSchemaName(), context.setOutputTable(new CatalogSchemaTableName( deleteHandle.getHandle().getConnectorId().getCatalogName(), deleteHandle.getSchemaTableName().getSchemaName(),
/** * Check if identity is allowed to insert into the specified table in a catalog. * * @throws AccessDeniedException if not allowed */ default void checkCanInsertIntoTable(Identity identity, CatalogSchemaTableName table) { denyInsertTable(table.toString()); }
if (writerTarget instanceof CreateHandle) { CreateHandle createHandle = (CreateHandle) writerTarget; context.setOutputTable(new CatalogSchemaTableName( createHandle.getHandle().getConnectorId().getCatalogName(), createHandle.getSchemaTableName().getSchemaName(), context.setOutputTable(new CatalogSchemaTableName( insertHandle.getHandle().getConnectorId().getCatalogName(), insertHandle.getSchemaTableName().getSchemaName(), context.setOutputTable(new CatalogSchemaTableName( deleteHandle.getHandle().getConnectorId().getCatalogName(), deleteHandle.getSchemaTableName().getSchemaName(),
/** * Check if identity is allowed to drop the specified view in a catalog. * * @throws AccessDeniedException if not allowed */ default void checkCanDropView(Identity identity, CatalogSchemaTableName view) { denyDropView(view.toString()); }
@Test public void testIOExplain() { String query = "SELECT * FROM orders"; MaterializedResult result = computeActual("EXPLAIN (TYPE IO, FORMAT JSON) " + query); TableColumnInfo input = new TableColumnInfo( new CatalogSchemaTableName("local", "sf0.01", "orders"), ImmutableSet.of( new ColumnConstraint( "orderstatus", createVarcharType(1).getTypeSignature(), new FormattedDomain( false, ImmutableSet.of( new FormattedRange( new FormattedMarker(Optional.of("F"), EXACTLY), new FormattedMarker(Optional.of("F"), EXACTLY)), new FormattedRange( new FormattedMarker(Optional.of("O"), EXACTLY), new FormattedMarker(Optional.of("O"), EXACTLY)), new FormattedRange( new FormattedMarker(Optional.of("P"), EXACTLY), new FormattedMarker(Optional.of("P"), EXACTLY))))))); assertEquals( jsonCodec(IOPlan.class).fromJson((String) getOnlyElement(result.getOnlyColumnAsSet())), new IOPlan(ImmutableSet.of(input), Optional.empty())); } }
/** * Check if identity is allowed to add columns to the specified table in a catalog. * * @throws AccessDeniedException if not allowed */ default void checkCanAddColumn(Identity identity, CatalogSchemaTableName table) { denyAddColumn(table.toString()); }
new IOPlan( ImmutableSet.of(new TableColumnInfo( new CatalogSchemaTableName(catalog, "tpch", "test_orders"), ImmutableSet.of( new ColumnConstraint( new IOPlan( ImmutableSet.of(new TableColumnInfo( new CatalogSchemaTableName(catalog, "tpch", "test_orders"), ImmutableSet.of( new ColumnConstraint(
/** * Check if identity is allowed to drop columns from the specified table in a catalog. * * @throws AccessDeniedException if not allowed */ default void checkCanDropColumn(Identity identity, CatalogSchemaTableName table) { denyDropColumn(table.toString()); }
new IoPlan( ImmutableSet.of(new TableColumnInfo( new CatalogSchemaTableName(catalog, "tpch", "test_orders"), ImmutableSet.of( new ColumnConstraint( new IoPlan( ImmutableSet.of(new TableColumnInfo( new CatalogSchemaTableName(catalog, "tpch", "test_orders"), ImmutableSet.of( new ColumnConstraint(
/** * Check if identity is allowed to delete from the specified table in a catalog. * * @throws AccessDeniedException if not allowed */ default void checkCanDeleteFromTable(Identity identity, CatalogSchemaTableName table) { denyDeleteTable(table.toString()); }