I am trying to fetch data whose last update date is greater that that of the existing data.
I created an oozie shell script to do so but the script failed. Can anyone suggest how do I accomplish this. Thanks in advance.
#!/bin/sh
hive -e 'use db2;select cast(lastupdate AS BIGINT) -3 lastupdate from table1
order by lastupdate desc limit 1 ;' > date_t1.txt
wait
value=`cat date_ods1.txt`
hive --hiveconf _maxdt=$value -e "set _maxdt;set hiveconf:_maxdt;
SELECT count(*)FROM (SELECT DISTINCT* FROM tab2 WHERE code='U' AND
cast(from_unixtime(unix_timestamp(to_date(eff_date), 'yyyy-MM-dd'),'yyyyMMdd') AS BIGINT)> \${hiveconf:_maxdt} ) a;"