This commit is contained in:
hzy9981 2025-04-10 16:21:37 +08:00 committed by GitHub
commit 969e16d69f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -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);

View File

@ -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())) {