导入失败:指定了重复的列标识符 (sqoop) [英] Imported Failed: Duplicate Column identifier specified (sqoop)

查看:65
本文介绍了导入失败:指定了重复的列标识符 (sqoop)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查询:

sqoop import --connect jdbc:mysql://localhost/userdb --username abc --password abc --query 'SELECT e.*,d.* FROM employee e JOIN department d on e.DEPTNO= d.DEPTNO WHERE $CONDITIONS ' --split-by e.DEPTNO --target-dir/output/result;

错误:

导入失败:指定了重复的列标识符 (sqoop)

Imported Failed: Duplicate Column identifier specified (sqoop)

推荐答案

当您选择查询中的所有列并且两个表具有相同的列 DEPTNO 时,这是预期行为.

It is expected behaviour as you are selecting all the columns in your query and both the tables has same column DEPTNO.

使用别名分别选择所有列.

以类似的方式修改您的查询:

Modify your query in the similar way:

--query 'SELECT e.col1 as ecol1, e.col2 as ecol2, e.col3 as ecol3, d.col1 as dcol1, d.col2 as dcol2, c.col3 as dcol3 FROM employee e JOINe.DEPTNO = d.DEPTNO WHERE $CONDITIONS'

这篇关于导入失败:指定了重复的列标识符 (sqoop)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆