Member since
10-31-2017
1
Post
0
Kudos Received
0
Solutions
10-31-2017
11:30 PM
Hello, I am facing problems in concatenating the value of a variable with a string . my script contains the below ******************************************************************************** set hivevar:tab_dt= substr(date_sub(current_date,1),1,10); CREATE TABLE default.udr_lt_bc_${hivevar:tab_dt} ( trans_id double ) ROW FORMAT DELIMITED FIELDS TERMINATED BY ","; *************************************************************** in the above, the variable tab_dt gets assigned correctly with yesterdays date in the format yyyymmdd. but when i try to concatenate this variable in a table name with a static string, the script fails. it is not doing the concatenation . Kindly provide a solution. note: i tried the below too, which is erroring out too set hivevar:tab_dt= substr(date_sub(current_date,1),1,10); set hivevar:tab_nm1= default.udr_lt_bc_; set hivevar:tab_name= concat(${hivevar:tab_dt},${hivevar:tab_nm1}) CREATE TABLE ${hivevar:tab_name} ( trans_id double ) ROW FORMAT DELIMITED FIELDS TERMINATED BY ","; This too is returning an error. Br Sandeep
... View more
Labels:
- Labels:
-
Apache Hive