增量“lastmodified”在sqoop中不起作用

qvtsj1bj  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(389)

我正在尝试sqoop执行从teradata db到hive的增量导入。以下是查询:

sqoop import --connect jdbc:teradata://xxx.xxx.x.xx/DATABASE=DBN --driver com.teradata.jdbc.TeraDriver --username userN --password pass --query "SELECT alias.colA, alias.call_date, alias.colB, alias.colC FROM tableName alias where \$CONDITIONS" --target-dir /apps/hive/warehouse/staging.db/tableName -m 26 --check-column call_date --incremental append --split-by alias.colA --last-value '2016-02-01'

列调用\u date是日期类型,值的格式为“yyyy-mm-dd”。
当我使用 'append' 为了 --incremental ,一切正常。但当我把 'lastmodified' ,将引发以下错误:

ERROR util.SqlTypeMap: It seems like you are looking up a column that does not 
ERROR util.SqlTypeMap: exist in the table. Please ensure that you've specified 
ERROR util.SqlTypeMap: correct column names in Sqoop options.                  
ERROR tool.ImportTool: Imported Failed: column not found: call_date

我在用 sqoop 1.4.4.2.1HDP 2.1 而teradata db 14.10 任何提示都会有帮助。

2mbi3lxu

2mbi3lxu1#

我认为,在查询的情况下,您可以在查询本身中执行最后一个值检查 "SELECT alias.colA, alias.call_date, alias.colB, alias.colC FROM tableName alias where call_date >'2016-02-01' and \$CONDITIONS" .
引用(请参阅“在配置单元>1中增量更新数据”一节。接收数据。)
https://docs.hortonworks.com/hdpdocuments/hdp2/hdp-2.3.0/bk_dataintegration/content/incrementally-updating-hive-table-with-sqoop-and-ext-table.html

相关问题