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));
|
||||
}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
Block a user