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