From 033a4b397edfacfb8fef98b7563e72729da99296 Mon Sep 17 00:00:00 2001 From: Mohammad Arshad Date: Sun, 6 Oct 2024 12:35:42 +0530 Subject: [PATCH] [Bug] [Seatunnel-web] [HiveJDBC] Duplicate columns are displayed in source (#221) --- .../plugin/hive/jdbc/HiveJdbcDataSourceChannel.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/seatunnel-datasource/seatunnel-datasource-plugins/datasource-jdbc-hive/src/main/java/org/apache/seatunnel/datasource/plugin/hive/jdbc/HiveJdbcDataSourceChannel.java b/seatunnel-datasource/seatunnel-datasource-plugins/datasource-jdbc-hive/src/main/java/org/apache/seatunnel/datasource/plugin/hive/jdbc/HiveJdbcDataSourceChannel.java index 1e62fa592..c56b9d828 100644 --- a/seatunnel-datasource/seatunnel-datasource-plugins/datasource-jdbc-hive/src/main/java/org/apache/seatunnel/datasource/plugin/hive/jdbc/HiveJdbcDataSourceChannel.java +++ b/seatunnel-datasource/seatunnel-datasource-plugins/datasource-jdbc-hive/src/main/java/org/apache/seatunnel/datasource/plugin/hive/jdbc/HiveJdbcDataSourceChannel.java @@ -179,9 +179,7 @@ protected List getTableNames(Map requestParams, String d List tableNames = new ArrayList<>(); try (Connection connection = getHiveConnection(requestParams)) { ResultSet resultSet = - connection - .getMetaData() - .getTables(dbName, dbName, null, new String[] {"TABLE"}); + connection.getMetaData().getTables(null, dbName, null, new String[] {"TABLE"}); while (resultSet.next()) { String tableName = resultSet.getString("TABLE_NAME"); if (StringUtils.isNotBlank(tableName)) { @@ -200,7 +198,7 @@ protected List getTableFields( try (Connection connection = getHiveConnection(requestParams)) { DatabaseMetaData metaData = connection.getMetaData(); String primaryKey = getPrimaryKey(metaData, dbName, tableName); - ResultSet resultSet = metaData.getColumns(dbName, null, tableName, null); + ResultSet resultSet = metaData.getColumns(null, dbName, tableName, null); while (resultSet.next()) { TableField tableField = new TableField(); String columnName = resultSet.getString("COLUMN_NAME");