Skip to content

Commit

Permalink
Disallow adding not null columns in Iceberg
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Aug 17, 2022
1 parent 23de48f commit 46afe06
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,10 @@ private static Term toIcebergTerm(Schema schema, PartitionField partitionField)
@Override
public void addColumn(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnMetadata column)
{
// TODO https://github.com/trinodb/trino/issues/13587 Allow NOT NULL constraint when the table is empty
if (!column.isNullable()) {
throw new TrinoException(NOT_SUPPORTED, "This connector does not support adding not null columns");
}
Table icebergTable = catalog.loadTable(session, ((IcebergTableHandle) tableHandle).getSchemaTableName());
icebergTable.updateSchema().addColumn(column.getName(), toIcebergType(column.getType()), column.getComment()).commit();
}
Expand Down

0 comments on commit 46afe06

Please sign in to comment.