Skip to content

Commit

Permalink
Format Iceberg table operation commit on own line
Browse files Browse the repository at this point in the history
For consistency with other places in the code; following formatting
rules of `Stream` usage.
  • Loading branch information
findepi committed Nov 3, 2022
1 parent 325dd89 commit ecd3e99
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1452,23 +1452,29 @@ public void addColumn(ConnectorSession session, ConnectorTableHandle tableHandle
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();
icebergTable.updateSchema()
.addColumn(column.getName(), toIcebergType(column.getType()), column.getComment())
.commit();
}

@Override
public void dropColumn(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnHandle column)
{
IcebergColumnHandle handle = (IcebergColumnHandle) column;
Table icebergTable = catalog.loadTable(session, ((IcebergTableHandle) tableHandle).getSchemaTableName());
icebergTable.updateSchema().deleteColumn(handle.getName()).commit();
icebergTable.updateSchema()
.deleteColumn(handle.getName())
.commit();
}

@Override
public void renameColumn(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnHandle source, String target)
{
IcebergColumnHandle columnHandle = (IcebergColumnHandle) source;
Table icebergTable = catalog.loadTable(session, ((IcebergTableHandle) tableHandle).getSchemaTableName());
icebergTable.updateSchema().renameColumn(columnHandle.getName(), target).commit();
icebergTable.updateSchema()
.renameColumn(columnHandle.getName(), target)
.commit();
}

private List<ColumnMetadata> getColumnMetadatas(Schema schema)
Expand Down

0 comments on commit ecd3e99

Please sign in to comment.