Search in sources :

Example 1 with ConnectorUpdateTableHandle

use of io.prestosql.spi.connector.ConnectorUpdateTableHandle in project hetu-core by openlookeng.

the class MetadataManager method beginUpdateAsInsert.

@Override
public UpdateTableHandle beginUpdateAsInsert(Session session, TableHandle tableHandle) {
    CatalogName catalogName = tableHandle.getCatalogName();
    CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, catalogName);
    ConnectorMetadata metadata = catalogMetadata.getMetadata();
    ConnectorTransactionHandle transactionHandle = catalogMetadata.getTransactionHandleFor(catalogName);
    ConnectorUpdateTableHandle handle = metadata.beginUpdateAsInsert(session.toConnectorSession(catalogName), tableHandle.getConnectorHandle());
    return new UpdateTableHandle(tableHandle.getCatalogName(), transactionHandle, handle);
}
Also used : ConnectorUpdateTableHandle(io.prestosql.spi.connector.ConnectorUpdateTableHandle) ConnectorTransactionHandle(io.prestosql.spi.connector.ConnectorTransactionHandle) CatalogName(io.prestosql.spi.connector.CatalogName) ConnectorMetadata(io.prestosql.spi.connector.ConnectorMetadata) ConnectorUpdateTableHandle(io.prestosql.spi.connector.ConnectorUpdateTableHandle)

Aggregations

CatalogName (io.prestosql.spi.connector.CatalogName)1 ConnectorMetadata (io.prestosql.spi.connector.ConnectorMetadata)1 ConnectorTransactionHandle (io.prestosql.spi.connector.ConnectorTransactionHandle)1 ConnectorUpdateTableHandle (io.prestosql.spi.connector.ConnectorUpdateTableHandle)1