Skip to content
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

mongodbReader读取报错列数不匹配 #1017

Open
ljl0303 opened this issue May 13, 2021 · 1 comment
Open

mongodbReader读取报错列数不匹配 #1017

ljl0303 opened this issue May 13, 2021 · 1 comment

Comments

@ljl0303
Copy link

ljl0303 commented May 13, 2021

经DataX智能分析,该任务最可能的错误原因是:
com.alibaba.datax.common.exception.DataXException: Code:[DBUtilErrorCode-00], Description:[您的配置错误.].  - 列配置信息有错误. 因为您配置的 任务中,源头读取字段数:0 与 目的表要写入的字段数:1 不相等. 请检查您的配置并作出修改.
        at com.alibaba.datax.common.exception.DataXException.asDataXException(DataXException.java:26)
        at com.alibaba.datax.plugin.rdbms.writer.CommonRdbmsWriter$Task.startWriteWithConnection(CommonRdbmsWriter.java:278)
        at com.alibaba.datax.plugin.rdbms.writer.CommonRdbmsWriter$Task.startWrite(CommonRdbmsWriter.java:319)
        at com.alibaba.datax.plugin.writer.mysqlwriter.MysqlWriter$Task.startWrite(MysqlWriter.java:78)
        at com.alibaba.datax.core.taskgroup.runner.WriterRunner.run(WriterRunner.java:56)
        at java.lang.Thread.run(Unknown Source)

是否是因为mongo内该字段不存在或者为null?但是我已经在query加了条件限制字段非null且存在,求大佬指导一下

@ljl0303
Copy link
Author

ljl0303 commented May 13, 2021

目前用的方法是给字段加默认值。
db.collection.updateMany(
{
"$or": [
{ "name": { "$exists": false } },
{ "name": null }
]
},
{ "$set": { "name": "test" } }
)

@ljl0303 ljl0303 closed this as completed May 13, 2021
@ljl0303 ljl0303 reopened this May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant