【问题标题】:incremental "lastmodified" not working in sqoop增量“lastmodified”在 sqoop 中不起作用
【发布时间】:2016-12-22 13:59:06
【问题描述】:

我正在尝试 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'

call_date 列是 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

我在HDP 2.1 上使用sqoop 1.4.4.2.1 而 Teradata DB 是 14.10

任何指针都会有所帮助。

【问题讨论】:

  • 通过查看错误,您提供的列名是否正确?
  • 是的,一切都正确。正如我上面提到的,如果我将lastmodified 更改为append,一切正常。
  • 可能与 Teradata 处理增量 lastmodified 导入中的此错误有关吗? issues.apache.org/jira/browse/SQOOP-2402

标签: hadoop hive teradata sqoop


【解决方案1】:

我认为,在查询的情况下,您可以在查询本身中执行最后一个值检查,有些人会这样认为

"SELECT alias.colA, alias.call_date, alias.colB, alias.colC FROM tableName alias where call_date >'2016-02-01' and \$CONDITIONS".

参考(参考Incrementally Updating Data in Hive > 1.Ingest the data.部分)

https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.0/bk_dataintegration/content/incrementally-updating-hive-table-with-sqoop-and-ext-table.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-14
    • 1970-01-01
    • 1970-01-01
    • 2017-06-10
    • 2015-04-22
    相关资源
    最近更新 更多