[feature] data synchronization function , through datax#1881
[feature] data synchronization function , through datax#1881qiaozhanwei merged 17 commits intoapache:devfrom
Conversation
|
pstmt and resultset need close |
1,The front end is named ETL, and the inside is implemented by Datax. It can be replaced by other implementations. |
fixed |
| /** | ||
| * datasource id | ||
| */ | ||
| private int datasource; |
There was a problem hiding this comment.
thx, let me fix it
| /** | ||
| * datatarget id | ||
| */ | ||
| private int datatarget; |
There was a problem hiding this comment.
thx, let me fix it
|
|
||
| @Override | ||
| public boolean checkParameters() { | ||
| if (!(datasource != 0 && StringUtils.isNotEmpty(dsType) && StringUtils.isNotEmpty(sql))) { |
There was a problem hiding this comment.
Whether these two if condition are considered to be combined into one?
There was a problem hiding this comment.
thx, let me fix it
data sync as this task name is more suitable than etl? |
|
New files UT coverage need add files at pom.xml at root. Like this: |
# Conflicts: # pom.xml
I think,A better name is DataX |
| String targetColumn = "`select`"; | ||
|
|
||
| assertEquals(DataxUtils.doConvertKeywordsColumn(DbType.MYSQL, fromColumn), targetColumn); | ||
| assertEquals(DataxUtils.doConvertKeywordsColumn(DbType.MYSQL, " \"`select`\" "), "`select`"); |
There was a problem hiding this comment.
assertEquals first param is expected value, sceond param is actual value, please swap there params.
|
|
||
| assertEquals(DataxUtils.doConvertKeywordsColumn(DbType.MYSQL, fromColumn), targetColumn); | ||
| assertEquals(DataxUtils.doConvertKeywordsColumn(DbType.MYSQL, " \"`select`\" "), "`select`"); | ||
| assertEquals(DataxUtils.doConvertKeywordsColumn(DbType.POSTGRESQL, " \"`select`\" "), "\"select\""); |
There was a problem hiding this comment.
assertEquals first param is expected value, sceond param is actual value, please swap there params, from 102-105 lines.
|
|
||
| Assert.assertTrue(columns.length == 2); | ||
|
|
||
| Assert.assertEquals(Arrays.toString(columns), "[`a`, `table`]"); |
There was a problem hiding this comment.
assertEquals first param is expected value, sceond param is actual value, please swap there params.
|
|
||
| Assert.assertTrue(columns.length == 2); | ||
|
|
||
| Assert.assertEquals(Arrays.toString(columns), "[a, b]"); |
There was a problem hiding this comment.
assertEquals first param is expected value, sceond param is actual value, please swap there params.
| Assert.assertNotNull(reader); | ||
|
|
||
| String readerPluginName = (String) reader.get("name"); | ||
| Assert.assertEquals(readerPluginName, DataxUtils.DATAX_READER_PLUGIN_MYSQL); |
There was a problem hiding this comment.
assertEquals first param is expected value, sceond param is actual value, please swap there params.
| Assert.assertNotNull(writer); | ||
|
|
||
| String writerPluginName = (String) writer.get("name"); | ||
| Assert.assertEquals(writerPluginName, DataxUtils.DATAX_WRITER_PLUGIN_MYSQL); |
There was a problem hiding this comment.
assertEquals first param is expected value, sceond param is actual value, please swap there params.
| public void testNotNull() | ||
| throws Exception { | ||
| try { | ||
| Method method = DataxTask.class.getDeclaredMethod("notNull", Object.class, String.class); |
|
Come on |
|
UT bug is fixed |
|
Kudos, SonarCloud Quality Gate passed!
|
please see this issue #1856