Consult a Hive SQL variable problem, please have a look at
The first kind, running
The set hivevar: curr_date='2017-03-11';
Select * from mytable where dt=${curr_date};
Second, running normally, but I don't understand why will Select statement given variables, in the subsequent call the variable so that when you need to write,
The set hivevar curr_date=Select Max (dt) from tb_date;
Select * from mytable where dt in (${curr_date});
Third, the following two writing error, where do you want to be, is the purpose of the extracted from mytable curr_date data with Last_date
The set hivevar: curr_date='2017-03-11';
The set hivevar Last_date=Select Max (dt) from tb_date;
Select * from mytable where dt & gt;=${curr_date} and dt & lt;=(${Last_date});
Select * from mytable where dt between ${curr_date} and (${Last_date});