alibaba / alibaba/DataX

MongoDB读取字段内容有空如何处理

Open
#2,290 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
17.4k
Forks
5.7k
PR merge metrics
No merged PRs in 30d

Description

MongoDB中的读取的字段有几个NULL值,结果转换时候总数报错,求大佬解答

[DataX插件运行时出错, 具体原因请参看DataX运行结束时的错误诊断信息 .]. - java.lang.NumberFormatException: Character N is neither a decimal digit number, decimal point, nor "e" notation exponential mark.

{
"setting":{
"speed":{
"channel":1
}
},
"content":[
{
"reader":{
"name":"mongodbreader",
"parameter":{
"address":[
"192.168.1.2:6010"
],
"dbName":"ams",
"collectionName":"test_tb",
"username":"test_reader",
"userPassword":"****************",
"column":[
{
"name":"schoolId",
"type":"string"
}
]
}
},
"writer":{
"name":"mysqlwriter",
"parameter":{
"column":[
"school_id"
],
"connection":[
{
"jdbcUrl":"jdbc:mysql://192.168.1.1:3020/ods",
"table":[
"ods.test1"
]
}
],
"password":"****************",
"username":"test",
"writeMode":"insert"
}
}
}
]
}

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the mongodbreader configuration and the reported NumberFormatException, then identify which field and value trigger conversion. The issue names no source file or test and does not define the expected handling for NULL values, so a reproducible case and agreed behavior are needed before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, mongodb, mysql
Domain
database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.