I am trying to write a file to s3 the name of which should contain current year day and month. To do this I want to define variables to get year, month and day
set year=year(from_unixtime(unix_timestamp()));
set month=month(from_unixtime(unix_timestamp()));
set day=day(from_unixtime(unix_timestamp()));
CREATE EXTERNAL TABLE abc (col1 int, col2 varchar(100), col3 INT)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS TEXTFILE LOCATION "s3://location_${hiveconf:year}${hiveconf:month}${hiveconf:day}/"
TBLPROPERTIES ("skip.header.line.count"="1");
If I run the script - 'select "${hiveconf:year}";' I get 'year(from_unixtime(unix_timestamp()))' as output.
Is there any other way to include day, month and year in the filename?