mirror of
https://github.com/alibaba/DataX.git
synced 2025-05-02 04:59:51 +08:00
Merge 8509d56fe2
into 0824b45c5e
This commit is contained in:
commit
969e16d69f
@ -162,6 +162,8 @@ public class MongoDBReader extends Reader {
|
|||||||
record.addColumn(new LongColumn((Integer) tempCol));
|
record.addColumn(new LongColumn((Integer) tempCol));
|
||||||
}else if (tempCol instanceof Long) {
|
}else if (tempCol instanceof Long) {
|
||||||
record.addColumn(new LongColumn((Long) tempCol));
|
record.addColumn(new LongColumn((Long) tempCol));
|
||||||
|
}else if (tempCol instanceof Document) {//兼容document数据类型
|
||||||
|
record.addColumn(new StringColumn(((Document) tempCol).toJson()));
|
||||||
} else {
|
} else {
|
||||||
if(KeyConstant.isArrayType(column.getString(KeyConstant.COLUMN_TYPE))) {
|
if(KeyConstant.isArrayType(column.getString(KeyConstant.COLUMN_TYPE))) {
|
||||||
String splitter = column.getString(KeyConstant.COLUMN_SPLITTER);
|
String splitter = column.getString(KeyConstant.COLUMN_SPLITTER);
|
||||||
|
@ -156,6 +156,9 @@ public class MongoDBWriter extends Writer{
|
|||||||
for(int i = 0; i < record.getColumnNumber(); i++) {
|
for(int i = 0; i < record.getColumnNumber(); i++) {
|
||||||
|
|
||||||
String type = columnMeta.getJSONObject(i).getString(KeyConstant.COLUMN_TYPE);
|
String type = columnMeta.getJSONObject(i).getString(KeyConstant.COLUMN_TYPE);
|
||||||
|
if(type==null) {
|
||||||
|
type = "string";
|
||||||
|
}
|
||||||
//空记录处理
|
//空记录处理
|
||||||
if (Strings.isNullOrEmpty(record.getColumn(i).asString())) {
|
if (Strings.isNullOrEmpty(record.getColumn(i).asString())) {
|
||||||
if (KeyConstant.isArrayType(type.toLowerCase())) {
|
if (KeyConstant.isArrayType(type.toLowerCase())) {
|
||||||
|
Loading…
Reference in New Issue
Block a user