Skip to content

Commit a81ba0c

Browse files
authored
Merge pull request #1392 from jtchen-study/master
DataX 通道能力更新(MaxCompute、Hologres、Tdengine、OSS)、安全漏洞更新、通用打包更新等
2 parents 9168f4c + a63f493 commit a81ba0c

File tree

162 files changed

+11665
-1850
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+11665
-1850
lines changed

NOTICE

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
========================================================
2+
DataX 是阿里云 DataWorks数据集成 的开源版本,在阿里巴巴集团内被广泛使用的离线数据同步工具/平台。DataX 实现了包括 MySQL、Oracle、OceanBase、SqlServer、Postgre、HDFS、Hive、ADS、HBase、TableStore(OTS)、MaxCompute(ODPS)、Hologres、DRDS 等各种异构数据源之间高效的数据同步功能。
3+
4+
DataX is an open source offline data synchronization tool / platform widely used in Alibaba group and other companies. DataX implements efficient data synchronization between heterogeneous data sources including mysql, Oracle, oceanbase, sqlserver, postgre, HDFS, hive, ads, HBase, tablestore (OTS), maxcompute (ODPs), hologres, DRDS, etc.
5+
6+
Copyright 1999-2022 Alibaba Group Holding Ltd.
7+
8+
Licensed under the Apache License, Version 2.0 (the "License");
9+
you may not use this file except in compliance with the License.
10+
You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing, software
15+
distributed under the License is distributed on an "AS IS" BASIS,
16+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
See the License for the specific language governing permissions and
18+
limitations under the License.
19+
20+
===================================================================
21+
文级别引用,按许可证
22+
This product contains various third-party components under other open source licenses.
23+
This section summarizes those components and their licenses.
24+
GNU Lesser General Public License
25+
--------------------------------------
26+
opentsdbreader/src/main/java/com/alibaba/datax/plugin/reader/conn/CliQuery.java
27+
opentsdbreader/src/main/java/com/alibaba/datax/plugin/reader/conn/Connection4TSDB.java
28+
opentsdbreader/src/main/java/com/alibaba/datax/plugin/reader/conn/DataPoint4TSDB.java
29+
opentsdbreader/src/main/java/com/alibaba/datax/plugin/reader/conn/DumpSeries.java
30+
opentsdbreader/src/main/java/com/alibaba/datax/plugin/reader/conn/OpenTSDBConnection.java
31+
opentsdbreader/src/main/java/com/alibaba/datax/plugin/reader/conn/OpenTSDBDump.java
32+
opentsdbreader/src/main/java/com/alibaba/datax/plugin/reader/opentsdbreader/Constant.java
33+
opentsdbreader/src/main/java/com/alibaba/datax/plugin/reader/opentsdbreader/Key.java
34+
opentsdbreader/src/main/java/com/alibaba/datax/plugin/reader/opentsdbreader/OpenTSDBReader.java
35+
opentsdbreader/src/main/java/com/alibaba/datax/plugin/reader/opentsdbreader/OpenTSDBReaderErrorCode.java
36+
opentsdbreader/src/main/java/com/alibaba/datax/plugin/reader/util/HttpUtils.java
37+
opentsdbreader/src/main/java/com/alibaba/datax/plugin/reader/util/TSDBUtils.java
38+
opentsdbreader/src/main/java/com/alibaba/datax/plugin/reader/util/TimeUtils.java
39+
===================================================================

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ DataX目前已经有了比较全面的插件体系,主流的RDBMS数据库、N
6262
| | Elasticsearch | ||[](https://github.com/alibaba/DataX/blob/master/elasticsearchwriter/doc/elasticsearchwriter.md)|
6363
| 时间序列数据库 | OpenTSDB || |[](https://github.com/alibaba/DataX/blob/master/opentsdbreader/doc/opentsdbreader.md)|
6464
| | TSDB |||[](https://github.com/alibaba/DataX/blob/master/tsdbreader/doc/tsdbreader.md)[](https://github.com/alibaba/DataX/blob/master/tsdbwriter/doc/tsdbhttpwriter.md)|
65-
| | TDengine |||[](https://github.com/taosdata/DataX/blob/master/tdenginereader/doc/tdenginereader.md)[](https://github.com/taosdata/DataX/blob/master/tdenginewriter/doc/tdenginewriter-CN.md)|
65+
| | 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)|
6666

6767
# 阿里云DataWorks数据集成
6868

adbpgwriter/src/main/doc/adbpgwriter.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ COPY命令将数据写入ADB PG数据库中。
6565
"writer": {
6666
"name": "adbpgwriter",
6767
"parameter": {
68-
"username": "username",
69-
"password": "password",
70-
"host": "host",
68+
"username": "",
69+
"password": "",
70+
"host": "127.0.0.1",
7171
"port": "1234",
7272
"database": "database",
7373
"schema": "schema",

common/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@
6161
</dependencies>
6262

6363
<build>
64+
<resources>
65+
<resource>
66+
<directory>src/main/java</directory>
67+
<includes>
68+
<include>**/*.properties</include>
69+
</includes>
70+
</resource>
71+
</resources>
6472
<plugins>
6573
<plugin>
6674
<artifactId>maven-compiler-plugin</artifactId>

common/src/main/java/com/alibaba/datax/common/element/BoolColumn.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,13 @@ public Date asDate() {
9292
throw DataXException.asDataXException(
9393
CommonErrorCode.CONVERT_NOT_SUPPORT, "Bool类型不能转为Date .");
9494
}
95-
95+
96+
@Override
97+
public Date asDate(String dateFormat) {
98+
throw DataXException.asDataXException(
99+
CommonErrorCode.CONVERT_NOT_SUPPORT, "Bool类型不能转为Date .");
100+
}
101+
96102
@Override
97103
public byte[] asBytes() {
98104
throw DataXException.asDataXException(

common/src/main/java/com/alibaba/datax/common/element/BytesColumn.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ public Date asDate() {
7575
throw DataXException.asDataXException(
7676
CommonErrorCode.CONVERT_NOT_SUPPORT, "Bytes类型不能转为Date .");
7777
}
78+
79+
@Override
80+
public Date asDate(String dateFormat) {
81+
throw DataXException.asDataXException(
82+
CommonErrorCode.CONVERT_NOT_SUPPORT, "Bytes类型不能转为Date .");
83+
}
7884

7985
@Override
8086
public Boolean asBoolean() {

common/src/main/java/com/alibaba/datax/common/element/Column.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ protected void setByteSize(int byteSize) {
5555
public abstract String asString();
5656

5757
public abstract Date asDate();
58+
59+
public abstract Date asDate(String dateFormat);
5860

5961
public abstract byte[] asBytes();
6062

common/src/main/java/com/alibaba/datax/common/element/ColumnCast.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ public static Date string2Date(final StringColumn column)
2222
throws ParseException {
2323
return StringCast.asDate(column);
2424
}
25+
26+
public static Date string2Date(final StringColumn column, String dateFormat)
27+
throws ParseException {
28+
return StringCast.asDate(column, dateFormat);
29+
}
2530

2631
public static byte[] string2Bytes(final StringColumn column)
2732
throws UnsupportedEncodingException {
@@ -115,6 +120,16 @@ static Date asDate(final StringColumn column) throws ParseException {
115120
}
116121
throw e;
117122
}
123+
124+
static Date asDate(final StringColumn column, String dateFormat) throws ParseException {
125+
ParseException e;
126+
try {
127+
return FastDateFormat.getInstance(dateFormat, StringCast.timeZoner).parse(column.asString());
128+
} catch (ParseException ignored) {
129+
e = ignored;
130+
}
131+
throw e;
132+
}
118133

119134
static byte[] asBytes(final StringColumn column)
120135
throws UnsupportedEncodingException {

common/src/main/java/com/alibaba/datax/common/element/DateColumn.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ public Date asDate() {
8989

9090
return new Date((Long)this.getRawData());
9191
}
92+
93+
@Override
94+
public Date asDate(String dateFormat) {
95+
return asDate();
96+
}
9297

9398
@Override
9499
public byte[] asBytes() {

common/src/main/java/com/alibaba/datax/common/element/DoubleColumn.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ public Date asDate() {
132132
throw DataXException.asDataXException(
133133
CommonErrorCode.CONVERT_NOT_SUPPORT, "Double类型无法转为Date类型 .");
134134
}
135+
136+
@Override
137+
public Date asDate(String dateFormat) {
138+
throw DataXException.asDataXException(
139+
CommonErrorCode.CONVERT_NOT_SUPPORT, "Double类型无法转为Date类型 .");
140+
}
135141

136142
@Override
137143
public byte[] asBytes() {

0 commit comments

Comments
 (0)