in paimon-trino-common/src/main/java/org/apache/paimon/trino/TrinoMetadataBase.java [296:313]
public void renameColumn(
ConnectorSession session,
ConnectorTableHandle tableHandle,
ColumnHandle source,
String target) {
TrinoTableHandle trinoTableHandle = (TrinoTableHandle) tableHandle;
Identifier identifier =
new Identifier(trinoTableHandle.getSchemaName(), trinoTableHandle.getTableName());
TrinoColumnHandle trinoColumnHandle = (TrinoColumnHandle) source;
List<SchemaChange> changes = new ArrayList<>();
changes.add(SchemaChange.renameColumn(trinoColumnHandle.getColumnName(), target));
try {
catalog.alterTable(identifier, changes, false);
} catch (Exception e) {
throw new RuntimeException(
format("failed to alter table: '%s'", trinoTableHandle.getTableName()), e);
}
}