0

I have a hive table in hive that is empty. Now I want to do incremental imports for this table.

When I query the table

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

I am getting a NULL value.

How can I pass this value to the sqoop incremental query.Say If null then pass as Zero or something

  • 1
    You don't need to maintain two accounts Interested_User and Active_User. One is sufficient. – Dev Mar 30 '17 at 06:03
  • @devツ No that is not my account I have checked the question of that user and got a doubt so posted a new question. As I have not enough reps to comment for that question –  Mar 30 '17 at 06:07
  • @Intrested_user I think 50reps should allow you to comment everywhere. – franklinsijo Mar 30 '17 at 06:09
  • 1
    @Intrested_user Your question is already answered here: http://stackoverflow.com/a/43103386/2700344 – leftjoin Mar 30 '17 at 07:16

1 Answers1

0

You can use below query to replace NULL with 0.

last_val = `hive -e "select NVL(max(id),0) from db.table"
Ashish Singh
  • 523
  • 3
  • 14
  • 1
    @Intrested_user its available in Hive. Check : https://issues.apache.org/jira/browse/HIVE-2288 – Dev Mar 30 '17 at 06:26