从空配置单元传递增量值 table

Pass incremental value from empty hive table

我的配置单元 table 中有一个空的配置单元。现在我想为此 table.

做增量导入

当我查询 table

last_val = `hive -e "select max(id) from db.table"

我得到一个 NULL 值。

如何将此值传递给 sqoop 增量查询。Say If null then pass as Zero or something

您可以使用以下查询将 NULL 替换为 0。

last_val = `hive -e "select NVL(max(id),0) from db.table"