1
votes

While trying to declare a variable ,then run a query using that variable in Hive on Hue (web client) .It is not working.

set MAX_DATE='2017-05-22 07:35:25';

select * from tablea where datetime = ${hivevar:Max_Date} limit 1

Following error message is seen:

Error while compiling statement: FAILED: ParseException line 1:83 cannot recognize input near '$' '{' 'hivevar' in expression specification

1
Web-client has menu Enable Parameterization and settings for adding key-value - leftjoin

1 Answers

1
votes

This will work:

set MAX_DATE='2017-05-22 07:35:25';

select * from tablea where datetime = '${hivevar:MAX_DATE}' limit 1;