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

Support setting column comments in ClickHouse #10641

Merged
merged 2 commits into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
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
7 changes: 1 addition & 6 deletions docs/src/main/sphinx/connector/clickhouse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,6 @@ statements, the connector supports the following features:

* :doc:`/sql/insert`
* :doc:`/sql/truncate`
* :doc:`/sql/create-table`
* :doc:`/sql/create-table-as`
* :doc:`/sql/drop-table`
* :doc:`/sql/create-schema`
* :doc:`/sql/drop-schema`
* :doc:`/sql/alter-schema`
* :ref:`sql-schema-table-management`

.. include:: alter-schema-limitation.fragment
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,17 @@ public void renameColumn(ConnectorSession session, JdbcTableHandle handle, JdbcC
}
}

@Override
public void setColumnComment(ConnectorSession session, JdbcTableHandle handle, JdbcColumnHandle column, Optional<String> comment)
{
String sql = format(
"ALTER TABLE %s COMMENT COLUMN %s '%s'",
quoted(handle.asPlainTable().getRemoteTableName()),
quoted(column.getColumnName()),
comment.orElse(""));
execute(session, sql);
}

@Override
public ResultSet getTables(Connection connection, Optional<String> schemaName, Optional<String> tableName)
throws SQLException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ protected boolean hasBehavior(TestingConnectorBehavior connectorBehavior)
return false;

case SUPPORTS_COMMENT_ON_TABLE:
case SUPPORTS_COMMENT_ON_COLUMN:
return false;

case SUPPORTS_ARRAY:
Expand Down