Skip to content

Commit

Permalink
Migrate CassandraMetadata to non-deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
losipiuk committed May 13, 2022
1 parent 95f829b commit aa6557d
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import io.trino.spi.connector.Constraint;
import io.trino.spi.connector.ConstraintApplicationResult;
import io.trino.spi.connector.NotFoundException;
import io.trino.spi.connector.RetryMode;
import io.trino.spi.connector.SchemaNotFoundException;
import io.trino.spi.connector.SchemaTableName;
import io.trino.spi.connector.SchemaTablePrefix;
Expand Down Expand Up @@ -63,6 +64,7 @@
import static io.trino.plugin.cassandra.util.CassandraCqlUtils.validTableName;
import static io.trino.spi.StandardErrorCode.NOT_SUPPORTED;
import static io.trino.spi.StandardErrorCode.PERMISSION_DENIED;
import static io.trino.spi.connector.RetryMode.NO_RETRIES;
import static java.lang.String.format;
import static java.util.Locale.ENGLISH;
import static java.util.Objects.requireNonNull;
Expand Down Expand Up @@ -275,8 +277,12 @@ public void dropTable(ConnectorSession session, ConnectorTableHandle tableHandle
}

@Override
public ConnectorOutputTableHandle beginCreateTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, Optional<ConnectorTableLayout> layout)
public ConnectorOutputTableHandle beginCreateTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, Optional<ConnectorTableLayout> layout, RetryMode retryMode)
{
if (retryMode != NO_RETRIES) {
throw new TrinoException(NOT_SUPPORTED, "This connector does not support query retries");
}

return createTable(tableMetadata);
}

Expand Down Expand Up @@ -335,8 +341,12 @@ public void truncateTable(ConnectorSession session, ConnectorTableHandle tableHa
}

@Override
public ConnectorInsertTableHandle beginInsert(ConnectorSession session, ConnectorTableHandle tableHandle)
public ConnectorInsertTableHandle beginInsert(ConnectorSession session, ConnectorTableHandle tableHandle, List<ColumnHandle> insertedColumns, RetryMode retryMode)
{
if (retryMode != NO_RETRIES) {
throw new TrinoException(NOT_SUPPORTED, "This connector does not support query retries");
}

CassandraTableHandle table = (CassandraTableHandle) tableHandle;
if (cassandraSession.isMaterializedView(table.getSchemaTableName())) {
throw new TrinoException(NOT_SUPPORTED, "Inserting into materialized views not yet supported");
Expand Down Expand Up @@ -383,7 +393,7 @@ public ColumnHandle getDeleteRowIdColumnHandle(ConnectorSession session, Connect
}

@Override
public ConnectorTableHandle beginDelete(ConnectorSession session, ConnectorTableHandle tableHandle)
public ConnectorTableHandle beginDelete(ConnectorSession session, ConnectorTableHandle tableHandle, RetryMode retryMode)
{
throw new TrinoException(NOT_SUPPORTED, "Delete without primary key or partition key is not supported");
}
Expand Down

0 comments on commit aa6557d

Please sign in to comment.