-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hdfswriter 写入出现 IO 异常 #374
Comments
麻烦贴出完整的输出日志 |
|
我大概找到问题了,是因为 int 字段有 null 值 |
这段代码应该能处理字段为 null 的吧 |
@wgzhao 我把目标端都改成 string 也会报这个错... |
你用的哪个版本,方便贴出 json 文件来吗? |
addax: 4.0.3 {
"content":[
{
"reader":{
"parameter":{
"path":"/user/hive/warehouse/xxx.db/xxx/dt=202101",
"column":[
{
"index":"0",
"type":"STRING"
},
{
"index":"1",
"type":"STRING"
},
{
"index":"2",
"type":"STRING"
},
{
"index":"3",
"type":"STRING"
},
{
"index":"4",
"type":"STRING"
},
{
"index":"5",
"type":"STRING"
},
{
"index":"6",
"type":"STRING"
},
{
"index":"7",
"type":"STRING"
},
{
"index":"8",
"type":"STRING"
},
{
"index":"9",
"type":"STRING"
},
{
"index":"10",
"type":"STRING"
},
{
"index":"11",
"type":"STRING"
},
{
"index":"12",
"type":"STRING"
},
{
"index":"13",
"type":"STRING"
},
{
"index":"14",
"type":"STRING"
},
{
"index":"15",
"type":"STRING"
},
{
"index":"16",
"type":"STRING"
},
{
"index":"17",
"type":"STRING"
},
{
"index":"18",
"type":"STRING"
},
{
"index":"19",
"type":"STRING"
},
{
"index":"20",
"type":"STRING"
},
{
"index":"21",
"type":"STRING"
},
{
"index":"22",
"type":"STRING"
},
{
"index":"23",
"type":"STRING"
},
{
"index":"24",
"type":"STRING"
},
{
"index":"25",
"type":"STRING"
},
{
"index":"26",
"type":"STRING"
},
{
"index":"27",
"type":"STRING"
},
{
"index":"28",
"type":"STRING"
},
{
"index":"29",
"type":"STRING"
},
{
"index":"30",
"type":"STRING"
},
{
"index":"31",
"type":"STRING"
},
{
"index":"32",
"type":"STRING"
},
{
"index":"33",
"type":"STRING"
},
{
"index":"34",
"type":"STRING"
},
{
"index":"35",
"type":"STRING"
},
{
"index":"36",
"type":"STRING"
},
{
"index":"37",
"type":"STRING"
},
{
"index":"38",
"type":"STRING"
},
{
"index":"39",
"type":"STRING"
}
],
"defaultFS":"hdfs://xxx:8020",
"encoding":"UTF-8",
"fileType":"parquet"
},
"name":"hdfsreader"
},
"writer":{
"parameter":{
"path":"/user/hive/warehouse/xxx.db/xxx/dt=202101",
"fileName":"xxx",
"column":[
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
},
{
"name":"xxx",
"type":"STRING"
}
],
"defaultFS":"hdfs://hdfs-namenode:8020",
"writeMode":"overwrite",
"fieldDelimiter":"\u0001",
"fileType":"parquet"
},
"name":"hdfswriter"
}
}
],
"setting":{
"speed":{
"channel":1
}
}
} |
@wgzhao 我把源和目标字段类型都改成 STRING 抽取了. 还是报错. |
不止字段类型的问题,我代码里有 test 例子,可以设置int 类型为null,是不会报错的。 |
大概知道原因了,我等下上传一个编译好jar包给你 |
请下载这个压缩文件,解压后替换 |
@wgzhao 666,可以了. |
@nmgliangwei 是的,增加了一个commit,当值为 |
@wgzhao 发现个问题,虽然写入了, 但是很多字段写入的都是这个" java.nio.HeapByteBuffer[pos=0 lim=22 cap=22] " 不同字段 lim 和 cap 值 不一样 |
我在本次测试看能否复现这个问题 |
本地没有复现这个问题,是什么类型的字段呢,是这些字段的值为空的情况吗? |
有 bigint 有 string 的字段, 字段中有 NULL 的情况, 我发现好像,源有值的,写入目标会变成java.nio.HeapByteBuffe, 源为 NULL 的,目标还是 NULL |
源 hadoop 版本:Hadoop 2.6.0 |
方便的话,源文件能给一个吗? |
@wgzhao 邮箱发你了点数据案例.你看一下. 我怀疑是读取的问题, 我把读取的换成 impala ,写入还是 hdfs parquet格式. 数据是正常的 |
从 hdfs 读取写入 hdfs 时出现 IO异常,看报错是下面这段代码出现了异常.

The text was updated successfully, but these errors were encountered: