From 0f91dd5d4dda293451ecb25ba0b6e550ad106a1f Mon Sep 17 00:00:00 2001 From: AliceXiaoLu Date: Wed, 21 Feb 2024 09:32:03 +0000 Subject: [PATCH] [Bug][chunjun-connectors] jdbc's properties not work where jdbc's reader has set properties --- .../chunjun/connector/jdbc/source/JdbcSourceFactory.java | 2 +- .../java/com/dtstack/chunjun/config/BaseFileConfigTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chunjun-connectors/chunjun-connector-jdbc-base/src/main/java/com/dtstack/chunjun/connector/jdbc/source/JdbcSourceFactory.java b/chunjun-connectors/chunjun-connector-jdbc-base/src/main/java/com/dtstack/chunjun/connector/jdbc/source/JdbcSourceFactory.java index 88afcf9f9a..cc41ef113a 100644 --- a/chunjun-connectors/chunjun-connector-jdbc-base/src/main/java/com/dtstack/chunjun/connector/jdbc/source/JdbcSourceFactory.java +++ b/chunjun-connectors/chunjun-connector-jdbc-base/src/main/java/com/dtstack/chunjun/connector/jdbc/source/JdbcSourceFactory.java @@ -89,7 +89,7 @@ public JdbcSourceFactory( if (StringUtils.isBlank(jdbcConfig.getIncreColumn())) jdbcConfig.setPolling(false); jdbcConfig.setColumn(syncConfig.getReader().getFieldList()); - Properties properties = syncConfig.getWriter().getProperties("properties", null); + Properties properties = syncConfig.getReader().getProperties("properties", null); jdbcConfig.setProperties(properties); setDefaultSplitStrategy(jdbcConfig); diff --git a/chunjun-core/src/test/java/com/dtstack/chunjun/config/BaseFileConfigTest.java b/chunjun-core/src/test/java/com/dtstack/chunjun/config/BaseFileConfigTest.java index 6febd549fa..7e81e47ea1 100644 --- a/chunjun-core/src/test/java/com/dtstack/chunjun/config/BaseFileConfigTest.java +++ b/chunjun-core/src/test/java/com/dtstack/chunjun/config/BaseFileConfigTest.java @@ -39,7 +39,7 @@ public void toStringShouldReturnAStringWithAllTheFields() { baseFileConf.setNextCheckRows(5000L); String expected = - "BaseFileConfig(fromLine=1, path=path, fileName=fileName, writeMode=writeMode, compress=compress, encoding=UTF-8, maxFileSize=1024, nextCheckRows=5000, suffix=null)"; + "BaseFileConfig(fromLine=1, path=path, fileName=fileName, writeMode=writeMode, compress=compress, encoding=UTF-8, maxFileSize=1024, nextCheckRows=5000, suffix=null, jobIdentifier=)"; assertEquals(expected, baseFileConf.toString()); }