in paimon-trino-368/src/main/java/org/apache/paimon/trino/TrinoMetadata.java [61:80]
public void setTableProperties(
ConnectorSession session,
ConnectorTableHandle tableHandle,
Map<String, Object> properties) {
TrinoTableHandle trinoTableHandle = (TrinoTableHandle) tableHandle;
Identifier identifier =
new Identifier(trinoTableHandle.getSchemaName(), trinoTableHandle.getTableName());
List<SchemaChange> changes = new ArrayList<>();
Map<String, String> options =
properties.entrySet().stream()
.collect(toMap(Map.Entry::getKey, e -> (String) e.getValue()));
options.forEach((key, value) -> changes.add(SchemaChange.setOption(key, value)));
// TODO: remove options, SET PROPERTIES x = DEFAULT
try {
catalog.alterTable(identifier, changes, false);
} catch (Exception e) {
throw new RuntimeException(
format("failed to alter table: '%s'", trinoTableHandle.getTableName()), e);
}
}