datax tdenginewriter 向TDengine写入错误报错:java.lang.NumberFormatException: For input string: "2022-07-04 03:20:49.566"
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 5.7k
- PR merge metrics
- No merged PRs in 30d
Description
1、参考官方示例(https://github.com/alibaba/DataX/blob/master/tdenginewriter/doc/tdenginewriter-CN.md)使用tdenginewriter向TDengine写入错误报错:java.lang.NumberFormatException: For input string: "2022-07-04 03:20:49.566"
示例中只是修改了连接信息,报错里的"2022-07-04 03:20:49.566" 在代码里都没有,不知道是从哪里来的?
TDengine版本: 2.4.0.16
驱动:taos-jdbcdriver-2.0.37.jar

2、报错信息如下:

3、job如下:
{
"job": {
"content": [
{
"reader": {
"name": "streamreader",
"parameter": {
"column": [
{
"type": "string",
"value": "tb1"
},
{
"type": "date",
"value": "2011-03-21 12:00:01"
},
{
"type": "long",
"random": "0, 10"
},
{
"type": "double",
"random": "0, 10"
},
{
"type": "bool",
"random": "0, 50"
},
{
"type": "bytes",
"value": "abcABC123"
},
{
"type": "string",
"value": "北京朝阳望京"
}
],
"sliceRecordCount": 1
}
},
"writer": {
"name": "tdenginewriter",
"parameter": {
"username": "root",
"password": "taosdata",
"column": [
"tbname",
"ts",
"temperature",
"humidity",
"is_normal",
"device_id",
"address"
],
"connection": [
{
"table": [
"weather"
],
"jdbcUrl": "jdbc:TAOS-RS://127.0.0.1:6041/soa_vehicle"
}
],
"batchSize": 100,
"ignoreTagsUnmatched": true
}
}
}
],
"setting": {
"speed": {
"channel": 1
}
}
}
}
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with tdenginewriter/doc/tdenginewriter-CN.md and the provided job configuration, focusing on how streamreader's date column is passed to tdenginewriter. Reproduce the failure with TDengine 2.4.0.16 and taos-jdbcdriver-2.0.37.jar, then trace the source of the timestamp string. Done means the documented example writes successfully without NumberFormatException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100