Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,26 +100,16 @@ DataX目前已经有了比较全面的插件体系,主流的RDBMS数据库、N
- 整库迁移:https://help.aliyun.com/document_detail/137809.html
- 批量上云:https://help.aliyun.com/document_detail/146671.html
- 更新更多能力请访问:https://help.aliyun.com/document_detail/137663.html
-


# 我要开发新的插件

请点击:[DataX插件开发宝典](https://github.com/alibaba/DataX/blob/master/dataxPluginDev.md)

# 重要版本更新说明

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

- [datax_v202309](https://github.com/alibaba/DataX/releases/tag/datax_v202309)
- 支持Phoenix 同步数据添加 where条件
- 支持华为 GuassDB读写插件
- 修复ClickReader 插件运行报错 Can't find bundle for base name
- 增加 DataX调试模块
- 修复 orc空文件报错问题
- 优化obwriter性能
- txtfilewriter 增加导出为insert语句功能支持
- HdfsReader/HdfsWriter 支持parquet读写能力

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

- [datax_v202308](https://github.com/alibaba/DataX/releases/tag/datax_v202308)
- OTS 插件更新
- databend 插件更新
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,62 +5,25 @@

import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Time;
import java.util.Date;

/**
* Created by jingxing on 14-8-24.
*/
public class DateColumn extends Column {

private DateType subType = DateType.DATETIME;

private int nanos = 0;

private int precision = -1;

public static enum DateType {
DATE, TIME, DATETIME
}

/**
* 构建值为time(java.sql.Time)的DateColumn,使用Date子类型为TIME,只有时间,没有日期
*/
public DateColumn(Time time, int nanos, int jdbcPrecision) {
this(time);
if (time != null) {
setNanos(nanos);
}
if (jdbcPrecision == 10) {
setPrecision(0);
}
if (jdbcPrecision >= 12 && jdbcPrecision <= 17) {
setPrecision(jdbcPrecision - 11);
}
}

public long getNanos() {
return nanos;
}

public void setNanos(int nanos) {
this.nanos = nanos;
}

public int getPrecision() {
return precision;
}

public void setPrecision(int precision) {
this.precision = precision;
}

/**
* 构建值为null的DateColumn,使用Date子类型为DATETIME
*/
public DateColumn() {
this((Long) null);
}
private DateType subType = DateType.DATETIME;

public static enum DateType {
DATE, TIME, DATETIME
}

/**
* 构建值为null的DateColumn,使用Date子类型为DATETIME
* */
public DateColumn() {
this((Long)null);
}

/**
* 构建值为stamp(Unix时间戳)的DateColumn,使用Date子类型为DATETIME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ private void checkPath(final String path) {
"系统编程错误, 该异常代表系统编程错误, 请联系DataX开发团队!.");
}

for (final String each : StringUtils.split(path, ".")) {
for (final String each : StringUtils.split(".")) {
if (StringUtils.isBlank(each)) {
throw new IllegalArgumentException(String.format(
"系统编程错误, 路径[%s]不合法, 路径层次之间不能出现空白字符 .", path));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ public static Configuration parseOnePluginConfig(final String path,
boolean isDefaultPath = StringUtils.isBlank(pluginPath);
if (isDefaultPath) {
configuration.set("path", path);
configuration.set("loadType","jarLoader");
}

Configuration result = Configuration.newDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* 提供Jar隔离的加载机制,会把传入的路径、及其子路径、以及路径中的jar文件加入到class path。
*/
public class JarLoader extends URLClassLoader{
public class JarLoader extends URLClassLoader {
public JarLoader(String[] paths) {
this(paths, JarLoader.class.getClassLoader());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public String value() {
/**
* jarLoader的缓冲
*/
private static Map<String, JarLoader> jarLoaderCenter = new HashMap();
private static Map<String, JarLoader> jarLoaderCenter = new HashMap<String, JarLoader>();

/**
* 设置pluginConfigs,方便后面插件来获取
Expand Down
17 changes: 9 additions & 8 deletions core/src/main/job/job.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,41 @@
"job": {
"setting": {
"speed": {
"channel": 2
"channel":1
},
"errorLimit": {
"record": 0
"record": 0,
"percentage": 0.02
}
},
"content": [
{
"reader": {
"name": "streamreader",
"parameter": {
"column": [
"column" : [
{
"value": "DataX",
"type": "string"
},
{
"value": 1724154616370,
"value": 19890604,
"type": "long"
},
{
"value": "2024-01-01 00:00:00",
"value": "1989-06-04 00:00:00",
"type": "date"
},
{
"value": true,
"type": "bool"
},
{
"value": "TestRawData",
"value": "test",
"type": "bytes"
}
],
"sliceRecordCount": 100
"sliceRecordCount": 100000
}
},
"writer": {
Expand All @@ -48,4 +49,4 @@
}
]
}
}
}
3 changes: 0 additions & 3 deletions dataxPluginDev.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,6 @@ DataX的内部类型在实现上会选用不同的java类型:
3. 用户在插件中在`reader`/`writer`配置的`name`字段指定插件名字。框架根据插件的类型(`reader`/`writer`)和插件名称去插件的路径下扫描所有的jar,加入`classpath`。
4. 根据插件配置中定义的入口类,框架通过反射实例化对应的`Job`和`Task`对象。

### 编写测试用例
1. 在datax-example工程下新建新的插件测试模块,调用`ExampleContainer.start(jobPath)`方法来检测你的代码逻辑是否正确。[datax-example使用](https://github.com/alibaba/DataX/blob/master/datax-example/doc/README.md)


## 三、Last but not Least

Expand Down
93 changes: 36 additions & 57 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@
</includes>
<outputDirectory>datax</outputDirectory>
</fileSet>
<fileSet>
<directory>obhbasereader/target/datax/</directory>
<includes>
<include>**/*.*</include>
</includes>
<outputDirectory>datax</outputDirectory>
</fileSet>
<fileSet>
<directory>drdsreader/target/datax/</directory>
<includes>
Expand Down Expand Up @@ -117,13 +110,13 @@
</includes>
<outputDirectory>datax</outputDirectory>
</fileSet>
<fileSet>
<directory>ossreader/target/datax/</directory>
<includes>
<include>**/*.*</include>
</includes>
<outputDirectory>datax</outputDirectory>
</fileSet>
<!-- <fileSet>-->
<!-- <directory>ossreader/target/datax/</directory>-->
<!-- <includes>-->
<!-- <include>**/*.*</include>-->
<!-- </includes>-->
<!-- <outputDirectory>datax</outputDirectory>-->
<!-- </fileSet>-->
<fileSet>
<directory>mongodbreader/target/datax/</directory>
<includes>
Expand Down Expand Up @@ -159,13 +152,13 @@
</includes>
<outputDirectory>datax</outputDirectory>
</fileSet>
<fileSet>
<directory>hdfsreader/target/datax/</directory>
<includes>
<include>**/*.*</include>
</includes>
<outputDirectory>datax</outputDirectory>
</fileSet>
<!-- <fileSet>-->
<!-- <directory>hdfsreader/target/datax/</directory>-->
<!-- <includes>-->
<!-- <include>**/*.*</include>-->
<!-- </includes>-->
<!-- <outputDirectory>datax</outputDirectory>-->
<!-- </fileSet>-->
<fileSet>
<directory>hbase11xreader/target/datax/</directory>
<includes>
Expand Down Expand Up @@ -244,14 +237,7 @@
<outputDirectory>datax</outputDirectory>
</fileSet>
<fileSet>
<directory>dorisreader/target/datax/</directory>
<includes>
<include>**/*.*</include>
</includes>
<outputDirectory>datax</outputDirectory>
</fileSet>
<fileSet>
<directory>sybasereader/target/datax/</directory>
<directory>qcubicreader/target/datax/</directory>
<includes>
<include>**/*.*</include>
</includes>
Expand Down Expand Up @@ -315,13 +301,13 @@
</includes>
<outputDirectory>datax</outputDirectory>
</fileSet>
<fileSet>
<directory>osswriter/target/datax/</directory>
<includes>
<include>**/*.*</include>
</includes>
<outputDirectory>datax</outputDirectory>
</fileSet>
<!-- <fileSet>-->
<!-- <directory>osswriter/target/datax/</directory>-->
<!-- <includes>-->
<!-- <include>**/*.*</include>-->
<!-- </includes>-->
<!-- <outputDirectory>datax</outputDirectory>-->
<!-- </fileSet>-->
<fileSet>
<directory>adswriter/target/datax/</directory>
<includes>
Expand Down Expand Up @@ -392,13 +378,13 @@
</includes>
<outputDirectory>datax</outputDirectory>
</fileSet>
<fileSet>
<directory>hdfswriter/target/datax/</directory>
<includes>
<include>**/*.*</include>
</includes>
<outputDirectory>datax</outputDirectory>
</fileSet>
<!-- <fileSet>-->
<!-- <directory>hdfswriter/target/datax/</directory>-->
<!-- <includes>-->
<!-- <include>**/*.*</include>-->
<!-- </includes>-->
<!-- <outputDirectory>datax</outputDirectory>-->
<!-- </fileSet>-->
<fileSet>
<directory>hbase11xwriter/target/datax/</directory>
<includes>
Expand Down Expand Up @@ -483,13 +469,6 @@
</includes>
<outputDirectory>datax</outputDirectory>
</fileSet>
<fileSet>
<directory>obhbasewriter/target/datax/</directory>
<includes>
<include>**/*.*</include>
</includes>
<outputDirectory>datax</outputDirectory>
</fileSet>
<fileSet>
<directory>gdbwriter/target/datax/</directory>
<includes>
Expand Down Expand Up @@ -539,12 +518,12 @@
</includes>
<outputDirectory>datax</outputDirectory>
</fileSet>
<fileSet>
<directory>sybasewriter/target/datax/</directory>
<includes>
<include>**/*.*</include>
</includes>
<outputDirectory>datax</outputDirectory>
</fileSet>
<!-- <fileSet>-->
<!-- <directory>qcubicwriter/target/datax/</directory>-->
<!-- <includes>-->
<!-- <include>**/*.*</include>-->
<!-- </includes>-->
<!-- <outputDirectory>datax</outputDirectory>-->
<!-- </fileSet>-->
</fileSets>
</assembly>
11 changes: 0 additions & 11 deletions plugin-rdbms-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,6 @@
<version>${mysql.driver.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oceanbase</groupId>
<artifactId>oceanbase-client</artifactId>
<version>2.4.11</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ protected Record buildRecord(RecordSender recordSender,ResultSet rs, ResultSetMe

try {
for (int i = 1; i <= columnNumber; i++) {

switch (metaData.getColumnType(i)) {

case Types.CHAR:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public class ObVersion implements Comparable<ObVersion> {
private int patchNumber;

public static final ObVersion V2276 = valueOf("2.2.76");
public static final ObVersion V2252 = valueOf("2.2.52");
public static final ObVersion V3 = valueOf("3.0.0.0");
public static final ObVersion V4000 = valueOf("4.0.0.0");

private static final ObVersion DEFAULT_VERSION =
Expand Down
Loading