Skip to content

Commit 0783394

Browse files
authored
Merge pull request #1570 from alibaba/opensource_2210
2210 Support OceanBase 4.x and fix OceanBase writer.
2 parents c91dc5f + c2c6a1b commit 0783394

File tree

6 files changed

+51
-41
lines changed

6 files changed

+51
-41
lines changed

README.md

Lines changed: 42 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ DataX本身作为数据同步框架,将不同数据源的同步抽象为从源
2525

2626
# Quick Start
2727

28-
##### Download [DataX下载地址](https://datax-opensource.oss-cn-hangzhou.aliyuncs.com/202209/datax.tar.gz)
28+
##### Download [DataX下载地址](https://datax-opensource.oss-cn-hangzhou.aliyuncs.com/202210/datax.tar.gz)
2929

3030

3131
##### 请点击:[Quick Start](https://github.com/alibaba/DataX/blob/master/userGuid.md)
@@ -36,36 +36,44 @@ DataX本身作为数据同步框架,将不同数据源的同步抽象为从源
3636

3737
DataX目前已经有了比较全面的插件体系,主流的RDBMS数据库、NOSQL、大数据计算系统都已经接入,目前支持数据如下图,详情请点击:[DataX数据源参考指南](https://github.com/alibaba/DataX/wiki/DataX-all-data-channels)
3838

39-
| 类型 | 数据源 | Reader(读) | Writer(写) |文档|
40-
| ------------ | ---------- | :-------: | :-------: |:-------: |
41-
| RDBMS 关系型数据库 | MySQL |||[](https://github.com/alibaba/DataX/blob/master/mysqlreader/doc/mysqlreader.md)[](https://github.com/alibaba/DataX/blob/master/mysqlwriter/doc/mysqlwriter.md)|
42-
|             | Oracle     |     √     |     √     |[](https://github.com/alibaba/DataX/blob/master/oraclereader/doc/oraclereader.md)[](https://github.com/alibaba/DataX/blob/master/oraclewriter/doc/oraclewriter.md)|
43-
|             | OceanBase  |     √     |     √     |[](https://open.oceanbase.com/docs/community/oceanbase-database/V3.1.0/use-datax-to-full-migration-data-to-oceanbase)[](https://open.oceanbase.com/docs/community/oceanbase-database/V3.1.0/use-datax-to-full-migration-data-to-oceanbase)|
44-
| | SQLServer |||[](https://github.com/alibaba/DataX/blob/master/sqlserverreader/doc/sqlserverreader.md)[](https://github.com/alibaba/DataX/blob/master/sqlserverwriter/doc/sqlserverwriter.md)|
45-
| | PostgreSQL |||[](https://github.com/alibaba/DataX/blob/master/postgresqlreader/doc/postgresqlreader.md)[](https://github.com/alibaba/DataX/blob/master/postgresqlwriter/doc/postgresqlwriter.md)|
46-
| | DRDS |||[](https://github.com/alibaba/DataX/blob/master/drdsreader/doc/drdsreader.md)[](https://github.com/alibaba/DataX/blob/master/drdswriter/doc/drdswriter.md)|
47-
| | Apache Doris | ||[](https://github.com/alibaba/DataX/blob/master/doriswriter/doc/doriswriter.md)|
48-
| | StarRocks | ||[](https://github.com/alibaba/DataX/blob/master/starrockswriter/doc/starrockswriter.md)|
49-
| | 通用RDBMS(支持所有关系型数据库) |||[](https://github.com/alibaba/DataX/blob/master/rdbmsreader/doc/rdbmsreader.md)[](https://github.com/alibaba/DataX/blob/master/rdbmswriter/doc/rdbmswriter.md)|
50-
| 阿里云数仓数据存储 | ODPS |||[](https://github.com/alibaba/DataX/blob/master/odpsreader/doc/odpsreader.md)[](https://github.com/alibaba/DataX/blob/master/odpswriter/doc/odpswriter.md)|
51-
| | ADS | ||[](https://github.com/alibaba/DataX/blob/master/adswriter/doc/adswriter.md)|
52-
| | OSS |||[](https://github.com/alibaba/DataX/blob/master/ossreader/doc/ossreader.md)[](https://github.com/alibaba/DataX/blob/master/osswriter/doc/osswriter.md)|
53-
| | OCS | ||[](https://github.com/alibaba/DataX/blob/master/ocswriter/doc/ocswriter.md)|
54-
| NoSQL数据存储 | OTS |||[](https://github.com/alibaba/DataX/blob/master/otsreader/doc/otsreader.md)[](https://github.com/alibaba/DataX/blob/master/otswriter/doc/otswriter.md)|
55-
| | Hbase0.94 |||[](https://github.com/alibaba/DataX/blob/master/hbase094xreader/doc/hbase094xreader.md)[](https://github.com/alibaba/DataX/blob/master/hbase094xwriter/doc/hbase094xwriter.md)|
56-
| | Hbase1.1 |||[](https://github.com/alibaba/DataX/blob/master/hbase11xreader/doc/hbase11xreader.md)[](https://github.com/alibaba/DataX/blob/master/hbase11xwriter/doc/hbase11xwriter.md)|
57-
| | Phoenix4.x |||[](https://github.com/alibaba/DataX/blob/master/hbase11xsqlreader/doc/hbase11xsqlreader.md)[](https://github.com/alibaba/DataX/blob/master/hbase11xsqlwriter/doc/hbase11xsqlwriter.md)|
58-
| | Phoenix5.x |||[](https://github.com/alibaba/DataX/blob/master/hbase20xsqlreader/doc/hbase20xsqlreader.md)[](https://github.com/alibaba/DataX/blob/master/hbase20xsqlwriter/doc/hbase20xsqlwriter.md)|
59-
| | MongoDB |||[](https://github.com/alibaba/DataX/blob/master/mongodbreader/doc/mongodbreader.md)[](https://github.com/alibaba/DataX/blob/master/mongodbwriter/doc/mongodbwriter.md)|
60-
| | Hive |||[](https://github.com/alibaba/DataX/blob/master/hdfsreader/doc/hdfsreader.md)[](https://github.com/alibaba/DataX/blob/master/hdfswriter/doc/hdfswriter.md)|
61-
| | Cassandra |||[](https://github.com/alibaba/DataX/blob/master/cassandrareader/doc/cassandrareader.md)[](https://github.com/alibaba/DataX/blob/master/cassandrawriter/doc/cassandrawriter.md)|
62-
| 无结构化数据存储 | TxtFile |||[](https://github.com/alibaba/DataX/blob/master/txtfilereader/doc/txtfilereader.md)[](https://github.com/alibaba/DataX/blob/master/txtfilewriter/doc/txtfilewriter.md)|
63-
| | FTP |||[](https://github.com/alibaba/DataX/blob/master/ftpreader/doc/ftpreader.md)[](https://github.com/alibaba/DataX/blob/master/ftpwriter/doc/ftpwriter.md)|
64-
| | HDFS |||[](https://github.com/alibaba/DataX/blob/master/hdfsreader/doc/hdfsreader.md)[](https://github.com/alibaba/DataX/blob/master/hdfswriter/doc/hdfswriter.md)|
65-
| | Elasticsearch | ||[](https://github.com/alibaba/DataX/blob/master/elasticsearchwriter/doc/elasticsearchwriter.md)|
66-
| 时间序列数据库 | OpenTSDB || |[](https://github.com/alibaba/DataX/blob/master/opentsdbreader/doc/opentsdbreader.md)|
67-
| | TSDB |||[](https://github.com/alibaba/DataX/blob/master/tsdbreader/doc/tsdbreader.md)[](https://github.com/alibaba/DataX/blob/master/tsdbwriter/doc/tsdbhttpwriter.md)|
68-
| | TDengine |||[](https://github.com/alibaba/DataX/blob/master/tdenginereader/doc/tdenginereader-CN.md)[](https://github.com/alibaba/DataX/blob/master/tdenginewriter/doc/tdenginewriter-CN.md)|
39+
| 类型 | 数据源 | Reader(读) |Writer(写)| 文档 |
40+
|--------------|---------------------------|:---------:|:-------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
41+
| RDBMS 关系型数据库 | MySQL ||| [](https://github.com/alibaba/DataX/blob/master/mysqlreader/doc/mysqlreader.md)[](https://github.com/alibaba/DataX/blob/master/mysqlwriter/doc/mysqlwriter.md) |
42+
| | Oracle ||| [](https://github.com/alibaba/DataX/blob/master/oraclereader/doc/oraclereader.md)[](https://github.com/alibaba/DataX/blob/master/oraclewriter/doc/oraclewriter.md) |
43+
| | OceanBase ||| [](https://open.oceanbase.com/docs/community/oceanbase-database/V3.1.0/use-datax-to-full-migration-data-to-oceanbase)[](https://open.oceanbase.com/docs/community/oceanbase-database/V3.1.0/use-datax-to-full-migration-data-to-oceanbase) |
44+
| | SQLServer ||| [](https://github.com/alibaba/DataX/blob/master/sqlserverreader/doc/sqlserverreader.md)[](https://github.com/alibaba/DataX/blob/master/sqlserverwriter/doc/sqlserverwriter.md) |
45+
| | PostgreSQL ||| [](https://github.com/alibaba/DataX/blob/master/postgresqlreader/doc/postgresqlreader.md)[](https://github.com/alibaba/DataX/blob/master/postgresqlwriter/doc/postgresqlwriter.md) |
46+
| | DRDS ||| [](https://github.com/alibaba/DataX/blob/master/drdsreader/doc/drdsreader.md)[](https://github.com/alibaba/DataX/blob/master/drdswriter/doc/drdswriter.md) |
47+
| | Kingbase ||| [](https://github.com/alibaba/DataX/blob/master/drdsreader/doc/drdsreader.md)[](https://github.com/alibaba/DataX/blob/master/drdswriter/doc/drdswriter.md) |
48+
| | 通用RDBMS(支持所有关系型数据库) ||| [](https://github.com/alibaba/DataX/blob/master/rdbmsreader/doc/rdbmsreader.md)[](https://github.com/alibaba/DataX/blob/master/rdbmswriter/doc/rdbmswriter.md) |
49+
| 阿里云数仓数据存储 | ODPS ||| [](https://github.com/alibaba/DataX/blob/master/odpsreader/doc/odpsreader.md)[](https://github.com/alibaba/DataX/blob/master/odpswriter/doc/odpswriter.md) |
50+
| | ADS | || [](https://github.com/alibaba/DataX/blob/master/adswriter/doc/adswriter.md) |
51+
| | OSS ||| [](https://github.com/alibaba/DataX/blob/master/ossreader/doc/ossreader.md)[](https://github.com/alibaba/DataX/blob/master/osswriter/doc/osswriter.md) |
52+
| | OCS | || [](https://github.com/alibaba/DataX/blob/master/ocswriter/doc/ocswriter.md) |
53+
| | Hologres | || [](https://github.com/alibaba/DataX/blob/master/hologresjdbcwriter/doc/hologresjdbcwriter.md) |
54+
| | AnalyticDB For PostgreSQL | |||
55+
| 阿里云中间件 | datahub ||| 读 、写 |
56+
| | SLS ||| 读 、写 |
57+
| 阿里云图数据库 | GDB ||| [](https://github.com/alibaba/DataX/blob/master/gdbreader/doc/gdbreader.md)[](https://github.com/alibaba/DataX/blob/master/gdbwriter/doc/gdbwriter.md) |
58+
| NoSQL数据存储 | OTS ||| [](https://github.com/alibaba/DataX/blob/master/otsreader/doc/otsreader.md)[](https://github.com/alibaba/DataX/blob/master/otswriter/doc/otswriter.md) |
59+
| | Hbase0.94 ||| [](https://github.com/alibaba/DataX/blob/master/hbase094xreader/doc/hbase094xreader.md)[](https://github.com/alibaba/DataX/blob/master/hbase094xwriter/doc/hbase094xwriter.md) |
60+
| | Hbase1.1 ||| [](https://github.com/alibaba/DataX/blob/master/hbase11xreader/doc/hbase11xreader.md)[](https://github.com/alibaba/DataX/blob/master/hbase11xwriter/doc/hbase11xwriter.md) |
61+
| | Phoenix4.x ||| [](https://github.com/alibaba/DataX/blob/master/hbase11xsqlreader/doc/hbase11xsqlreader.md)[](https://github.com/alibaba/DataX/blob/master/hbase11xsqlwriter/doc/hbase11xsqlwriter.md) |
62+
| | Phoenix5.x ||| [](https://github.com/alibaba/DataX/blob/master/hbase20xsqlreader/doc/hbase20xsqlreader.md)[](https://github.com/alibaba/DataX/blob/master/hbase20xsqlwriter/doc/hbase20xsqlwriter.md) |
63+
| | MongoDB ||| [](https://github.com/alibaba/DataX/blob/master/mongodbreader/doc/mongodbreader.md)[](https://github.com/alibaba/DataX/blob/master/mongodbwriter/doc/mongodbwriter.md) |
64+
| | Cassandra ||| [](https://github.com/alibaba/DataX/blob/master/cassandrareader/doc/cassandrareader.md)[](https://github.com/alibaba/DataX/blob/master/cassandrawriter/doc/cassandrawriter.md) |
65+
| 数仓数据存储 | StarRocks ||| 读 、[](https://github.com/alibaba/DataX/blob/master/starrockswriter/doc/starrockswriter.md) |
66+
| | ApacheDoris | || [](https://github.com/alibaba/DataX/blob/master/doriswriter/doc/doriswriter.md) |
67+
| | ClickHouse | |||
68+
| | Hive ||| [](https://github.com/alibaba/DataX/blob/master/hdfsreader/doc/hdfsreader.md)[](https://github.com/alibaba/DataX/blob/master/hdfswriter/doc/hdfswriter.md) |
69+
| | kudu | || [](https://github.com/alibaba/DataX/blob/master/hdfswriter/doc/hdfswriter.md) |
70+
| 无结构化数据存储 | TxtFile ||| [](https://github.com/alibaba/DataX/blob/master/txtfilereader/doc/txtfilereader.md)[](https://github.com/alibaba/DataX/blob/master/txtfilewriter/doc/txtfilewriter.md) |
71+
| | FTP ||| [](https://github.com/alibaba/DataX/blob/master/ftpreader/doc/ftpreader.md)[](https://github.com/alibaba/DataX/blob/master/ftpwriter/doc/ftpwriter.md) |
72+
| | HDFS ||| [](https://github.com/alibaba/DataX/blob/master/hdfsreader/doc/hdfsreader.md)[](https://github.com/alibaba/DataX/blob/master/hdfswriter/doc/hdfswriter.md) |
73+
| | Elasticsearch | || [](https://github.com/alibaba/DataX/blob/master/elasticsearchwriter/doc/elasticsearchwriter.md) |
74+
| 时间序列数据库 | OpenTSDB || | [](https://github.com/alibaba/DataX/blob/master/opentsdbreader/doc/opentsdbreader.md) |
75+
| | TSDB ||| [](https://github.com/alibaba/DataX/blob/master/tsdbreader/doc/tsdbreader.md)[](https://github.com/alibaba/DataX/blob/master/tsdbwriter/doc/tsdbhttpwriter.md) |
76+
| | TDengine ||| [](https://github.com/alibaba/DataX/blob/master/tdenginereader/doc/tdenginereader-CN.md)[](https://github.com/alibaba/DataX/blob/master/tdenginewriter/doc/tdenginewriter-CN.md) |
6977

7078
# 阿里云DataWorks数据集成
7179

@@ -97,6 +105,9 @@ DataX目前已经有了比较全面的插件体系,主流的RDBMS数据库、N
97105

98106
DataX 后续计划月度迭代更新,也欢迎感兴趣的同学提交 Pull requests,月度更新内容会介绍介绍如下。
99107

108+
- [datax_v202210]https://github.com/alibaba/DataX/releases/tag/datax_v202210)
109+
- 涉及通道能力更新(OceanBase、Tdengine、Doris等)
110+
100111
- [datax_v202209]https://github.com/alibaba/DataX/releases/tag/datax_v202209)
101112
- 涉及通道能力更新(MaxCompute、Datahub、SLS等)、安全漏洞更新、通用打包更新等
102113

oceanbasev10reader/src/main/java/com/alibaba/datax/plugin/reader/oceanbasev10reader/util/ObVersion.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public class ObVersion implements Comparable<ObVersion> {
1616
private int patchNumber;
1717

1818
public static final ObVersion V2276 = valueOf("2.2.76");
19+
public static final ObVersion V4000 = valueOf("4.0.0.0");
20+
1921
private static final ObVersion DEFAULT_VERSION =
2022
valueOf(System.getProperty("defaultObVersion","3.2.3.0"));
2123

oceanbasev10reader/src/main/java/com/alibaba/datax/plugin/reader/oceanbasev10reader/util/PartitionSplitUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ public static PartInfo getObMySQLPartInfoBySQL(Configuration config, String tabl
157157

158158
conn = DBUtil.getConnection(DataBaseType.OceanBase, jdbcUrl, username, password);
159159
ObVersion obVersion = ObReaderUtils.getObVersion(conn);
160-
if (obVersion.compareTo(ObVersion.V2276) >= 0) {
160+
if (obVersion.compareTo(ObVersion.V2276) >= 0 &&
161+
obVersion.compareTo(ObVersion.V4000) < 0) {
161162
allTable = "__all_table_v2";
162163
}
163164

oceanbasev10writer/src/main/java/com/alibaba/datax/plugin/writer/oceanbasev10writer/task/ConcurrentTableWriterTask.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ public ConcurrentTableWriterTask(DataBaseType dataBaseType) {
7676
private Condition condition = lock.newCondition();
7777

7878
private long startTime;
79-
private boolean isOb2 = false;
8079
private String obWriteMode = "update";
8180
private boolean isOracleCompatibleMode = false;
8281
private String obUpdateColumns = null;
@@ -130,12 +129,6 @@ public void init(Configuration config) {
130129
concurrentWriter = new ConcurrentTableWriter(config, connectInfo, writeRecordSql);
131130
allTaskInQueue = false;
132131
}
133-
134-
String version = config.getString(Config.OB_VERSION);
135-
int pIdx = version.lastIndexOf('.');
136-
if ((Float.valueOf(version.substring(0, pIdx)) >= 2.1f)) {
137-
isOb2 = true;
138-
}
139132
}
140133

141134
private void initPartCalculator(ServerConnectInfo connectInfo) {
@@ -313,7 +306,7 @@ private void addRecordToCache(final Record record) {
313306
LOG.warn("fail to get partition id: " + e1.getMessage() + ", record: " + record);
314307
}
315308

316-
if (partId == null && isOb2) {
309+
if (partId == null) {
317310
LOG.debug("fail to calculate parition id, just put into the default buffer.");
318311
partId = Long.MAX_VALUE;
319312
}

plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/util/DBUtil.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,9 @@ private static synchronized Connection connect(DataBaseType dataBaseType,
380380
// unit ms
381381
prop.put("oracle.jdbc.ReadTimeout", socketTimeout);
382382
}
383+
if (dataBaseType == DataBaseType.OceanBase) {
384+
url = url.replace("jdbc:mysql:", "jdbc:oceanbase:");
385+
}
383386

384387
return connect(dataBaseType, url, prop);
385388
}

userGuid.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ DataX本身作为数据同步框架,将不同数据源的同步抽象为从源
1717

1818
* 工具部署
1919

20-
* 方法一、直接下载DataX工具包:[DataX下载地址](http://datax-opensource.oss-cn-hangzhou.aliyuncs.com/datax.tar.gz)
20+
* 方法一、直接下载DataX工具包:[DataX下载地址](https://datax-opensource.oss-cn-hangzhou.aliyuncs.com/202210/datax.tar.gz)
2121

2222
下载后解压至本地某个目录,进入bin目录,即可运行同步作业:
2323

0 commit comments

Comments
 (0)