diff --git a/flink-doris-connector/src/test/java/org/apache/doris/flink/tools/cdc/MySQLDorisE2ECase.java b/flink-doris-connector/src/test/java/org/apache/doris/flink/tools/cdc/MySQLDorisE2ECase.java index 30889aa3b..5de170d4e 100644 --- a/flink-doris-connector/src/test/java/org/apache/doris/flink/tools/cdc/MySQLDorisE2ECase.java +++ b/flink-doris-connector/src/test/java/org/apache/doris/flink/tools/cdc/MySQLDorisE2ECase.java @@ -471,19 +471,19 @@ private void printClusterStatus() throws SQLException { try (Statement statement = connection.createStatement(); ResultSet showFrontends = statement.executeQuery("show frontends"); ResultSet showBackends = statement.executeQuery("show backends")) { - LOG.info("Frontends status: ", convertList(showFrontends)); - LOG.info("Backends status: ", convertList(showBackends)); + LOG.info("Frontends status: ", convertList(showFrontends, showFrontends.getMetaData())); + LOG.info("Backends status: ", convertList(showBackends, showBackends.getMetaData())); } } - private static List convertList(ResultSet rs) throws SQLException { + private static List convertList(ResultSet rs, ResultSetMetaData metaData) + throws SQLException { List list = new ArrayList<>(); - ResultSetMetaData md = rs.getMetaData(); - int columnCount = md.getColumnCount(); + int columnCount = metaData.getColumnCount(); while (rs.next()) { Map rowData = new HashMap<>(); for (int i = 1; i <= columnCount; i++) { - rowData.put(md.getColumnName(i), rs.getObject(i)); + rowData.put(metaData.getColumnName(i), rs.getObject(i)); } list.add(rowData); }