From 34b7412bff4c5ca2e217e61bfe4487cae5fad409 Mon Sep 17 00:00:00 2001 From: inrgihc Date: Fri, 22 Sep 2023 22:35:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3clickhouse=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../clickhouse/ClickhouseMetadataQueryProvider.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dbswitch-product/dbswitch-product-clickhouse/src/main/java/com/gitee/dbswitch/product/clickhouse/ClickhouseMetadataQueryProvider.java b/dbswitch-product/dbswitch-product-clickhouse/src/main/java/com/gitee/dbswitch/product/clickhouse/ClickhouseMetadataQueryProvider.java index 0cd3d75e..dfe8e6b4 100644 --- a/dbswitch-product/dbswitch-product-clickhouse/src/main/java/com/gitee/dbswitch/product/clickhouse/ClickhouseMetadataQueryProvider.java +++ b/dbswitch-product/dbswitch-product-clickhouse/src/main/java/com/gitee/dbswitch/product/clickhouse/ClickhouseMetadataQueryProvider.java @@ -116,6 +116,19 @@ public class ClickhouseMetadataQueryProvider extends AbstractMetadataProvider { } } + @Override + public List queryTableColumnMeta(Connection connection, String schemaName, + String tableName) { + List results = super.queryTableColumnMeta(connection, schemaName, tableName); + for (ColumnDescription column : results) { + if (StringUtils.equals(column.getFieldTypeName(), "Nullable(String)") + || StringUtils.equals(column.getFieldTypeName(), "String")) { + column.setDisplaySize(Constants.CLOB_LENGTH); + } + } + return results; + } + @Override public List queryTablePrimaryKeys(Connection connection, String schemaName, String tableName) { List result = new ArrayList<>();