Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format Iceberg table operation commit on own line #14804

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1430,23 +1430,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