Sqoop 提供了可被用于检索新的行级数据的增量导入模式。
增量导入参数:
Argument | Description |
---|---|
--check-column (col) | Specifies the column to be examined when determining which rows to import. |
--incremental (mode) | Specifies how Sqoop determines which rows are new. Legal values for mode include append and lastmodified . |
--last-value (value) | Specifies the maximum value of the check column from the previous import. |
--check-column :指定导入数据时需要检索的字段
--incremental: 指定sqoop如何选定新行。包括append、lastmodified两种模式
--last-value:指定所需检索字段上次同步时的最大字段。
Sqoop支持两种增量导入:append和lastmodified。你可以使用--incremental 参数来决定使用使用那种类型。
当一个表持续的使用自增ID来增加数据时,应该指定append模式,使用--check-column来制定包含行ID的字段。
--last-value设置一个值,sqoop在导入数据时会选择比这个值大的数据进行导入。