从空的hive表传递增量值

时间:2017-03-30 04:34:46

标签: mysql hadoop hive sqoop

我在hive中有一个空的hive表。现在我想为这个表做增量导入。

当我查询表格时

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

我的价值为NULL

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

1 个答案:

答案 0 :(得分:0)

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

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