From c55bc4f8a96ea343bd8d3c81a83f6a853a2c0aba Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Fri, 25 Feb 2022 16:20:38 +0100 Subject: [PATCH] Move updateColumnComment next to updateTableComment --- .../trino/plugin/iceberg/TrinoHiveCatalog.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/TrinoHiveCatalog.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/TrinoHiveCatalog.java index 2de71e849646..c4701f64784b 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/TrinoHiveCatalog.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/TrinoHiveCatalog.java @@ -375,6 +375,15 @@ public void updateTableComment(ConnectorSession session, SchemaTableName schemaT } } + @Override + public void updateColumnComment(ConnectorSession session, SchemaTableName schemaTableName, ColumnIdentity columnIdentity, Optional comment) + { + metastore.commentColumn(schemaTableName.getSchemaName(), schemaTableName.getTableName(), columnIdentity.getName(), comment); + + Table icebergTable = loadTable(session, schemaTableName); + icebergTable.updateSchema().updateColumnDoc(columnIdentity.getName(), comment.orElse(null)).commit(); + } + @Override public String defaultTableLocation(ConnectorSession session, SchemaTableName schemaTableName) { @@ -723,15 +732,6 @@ private List listNamespaces(ConnectorSession session, Optional n return listNamespaces(session); } - @Override - public void updateColumnComment(ConnectorSession session, SchemaTableName schemaTableName, ColumnIdentity columnIdentity, Optional comment) - { - metastore.commentColumn(schemaTableName.getSchemaName(), schemaTableName.getTableName(), columnIdentity.getName(), comment); - - Table icebergTable = loadTable(session, schemaTableName); - icebergTable.updateSchema().updateColumnDoc(columnIdentity.getName(), comment.orElse(null)).commit(); - } - private static class MaterializedViewMayBeBeingRemovedException extends RuntimeException {