-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
使用JSON Splitter拆分记录中的JSON字段内容出错, modify for datavane/tis#390
- Loading branch information
1 parent
ddd052d
commit bacf0d4
Showing
22 changed files
with
450 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...c/test/java/com/qlangtech/tis/plugin/ds/sqlserver/TestSqlServer2019DatasourceFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.qlangtech.tis.plugin.ds.sqlserver; | ||
|
||
import org.junit.Test; | ||
|
||
import java.sql.Date; | ||
import java.sql.PreparedStatement; | ||
import java.sql.SQLType; | ||
import java.sql.Types; | ||
|
||
/** | ||
* @author: 百岁([email protected]) | ||
* @create: 2024-11-02 15:05 | ||
**/ | ||
public class TestSqlServer2019DatasourceFactory { | ||
@Test | ||
public void testConnect() { | ||
SqlServer2019DatasourceFactory sqlServer2019DatasourceFactory = new SqlServer2019DatasourceFactory(); | ||
sqlServer2019DatasourceFactory.name = "test"; | ||
sqlServer2019DatasourceFactory.dbName = "tis"; | ||
sqlServer2019DatasourceFactory.useSSL = false; | ||
sqlServer2019DatasourceFactory.nodeDesc = "192.168.28.201"; | ||
sqlServer2019DatasourceFactory.port = 1433; | ||
sqlServer2019DatasourceFactory.userName = "sa"; | ||
sqlServer2019DatasourceFactory.password = "Hello1234!"; | ||
|
||
sqlServer2019DatasourceFactory.visitFirstConnection((conn) -> { | ||
try (PreparedStatement preparedStatement = conn.getConnection().prepareStatement("insert into base(base_id,update_date,col_blob) values( ?, ?, ? )")) { | ||
preparedStatement.setInt(1, 24); | ||
preparedStatement.setTimestamp(2, new java.sql.Timestamp(System.currentTimeMillis())); | ||
preparedStatement.setObject(3, null, Types.NULL); | ||
preparedStatement.execute(); | ||
} | ||
}); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
import com.qlangtech.tis.plugin.datax.dameng.ds.DaMengDataSourceFactory; | ||
import com.qlangtech.tis.plugin.datax.dameng.writer.DataXDaMengWriter; | ||
import com.qlangtech.tis.plugin.ds.BasicDataSourceFactory; | ||
import com.qlangtech.tis.plugin.ds.CMeta; | ||
import com.qlangtech.tis.plugin.ds.oracle.DamengDSFactoryContainer; | ||
import com.qlangtech.tis.plugin.ds.oracle.TISDamengContainer; | ||
import com.qlangtech.tis.plugins.incr.flink.connector.ChunjunSinkFactory; | ||
|
@@ -34,6 +35,7 @@ | |
import org.junit.Test; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* @author: 百岁([email protected]) | ||
|
@@ -67,17 +69,18 @@ public static void stop() { | |
|
||
@Override | ||
protected UpdateMode createIncrMode() { | ||
// InsertType insertType = new InsertType(); | ||
// InsertType insertType = new InsertType(); | ||
UpsertType updateMode = new UpsertType(); | ||
// UpdateType updateMode = new UpdateType(); | ||
// UpdateType updateMode = new UpdateType(); | ||
// updateMode.updateKey = Lists.newArrayList(colId, updateTime); | ||
return updateMode; | ||
} | ||
|
||
@Override | ||
protected ArrayList<String> getUniqueKey() { | ||
return Lists.newArrayList(colId, updateTime); | ||
} | ||
// @Override | ||
// protected ArrayList<String> getUniqueKey(List<CMeta> metaCols) { | ||
// // return Lists.newArrayList(colId, updateTime); | ||
// return super.getUniqueKey(metaCols); | ||
// } | ||
|
||
@Override | ||
protected BasicDataSourceFactory getDsFactory() { | ||
|
@@ -87,6 +90,7 @@ protected BasicDataSourceFactory getDsFactory() { | |
@Test | ||
@Override | ||
public void testSinkSync() throws Exception { | ||
|
||
super.testSinkSync(); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ | |
import org.junit.Test; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* @author: 百岁([email protected]) | ||
|
@@ -71,7 +72,7 @@ protected UpdateMode createIncrMode() { | |
} | ||
|
||
@Override | ||
protected ArrayList<String> getUniqueKey() { | ||
protected List<String> getUniqueKey(List<CMeta> metaCols) { | ||
return Lists.newArrayList(colId); | ||
} | ||
|
||
|
Oops, something went wrong.