开发者社区 问答 正文

BUG:exception:setl:com.alibaba.otter.node.etl.tran

从一个表拆分到多个表的情况下发现一个低级BUG,害人不浅啊。

com.alibaba.otter.node.etl.transform.transformer.RowDataTransformer.java private String buildName(String name, ModeValue sourceModeValue, ModeValue targetModeValue) { if (targetModeValue.getMode().isWildCard()) { return name; // 通配符,认为源和目标一定是一致的 } else if (targetModeValue.getMode().isMulti()) { int index = ConfigHelper.indexIgnoreCase(sourceModeValue.getMultiValue(), name); if (index == -1) { throw new TransformException("can not found namespace or name in media:" + sourceModeValue.toString()); }

        return targetModeValue.getMultiValue().get(index);
    } else {
        return targetModeValue.getSingleValue();
    }
}

第161行

int index = ConfigHelper.indexIgnoreCase(sourceModeValue.getMultiValue(), name); 应该改成

int index = ConfigHelper.indexIgnoreCase(targetModeValue.getMultiValue(), name); 源表 user 目标表 user_[0-31]

原提问者GitHub用户hyberbin

展开
收起
古拉古拉 2023-06-16 20:46:48 77 发布于北京 分享
分享
版权
举报
1 条回答
写回答
取消 提交回答
  • 你理解错了,你看javadoc的注释,就不支持你这种源表一张,目标表多张的情况.目标多表,源也必须多表。 单表拆多表,没法知道选哪张

    原回答者GitHub用户agapple

    2023-06-16 21:35:46 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论
问答标签:
问答地址: