Passing timestamp dynamically to hql script in talend job

Five Stars

Passing timestamp dynamically to hql script in talend job

Hi All,

I want to pass timestamp dynamically  to hql script in Talend job.

I have to get the 20 days old date in a variable and pass that value to the hql script.

I have used thiverow in my Talend design to call hql script.

 

image.png

 

For example 20 days old timestamp is '2018-11-24 07:12:18.371'

 

This timestamp '2018-11-24 07:12:18.371has to be the below hql.

 

inserttbl=INSERT OVERWRITE TABLE mv_target PARTITION (name,cdt) SELECT * from mv_source WHERE cdt<=timestamp '2018-11-24 07:12:18.371'

 

Please help me.

 

Thanks in advance.

 

 

 

Five Stars

Re: Passing timestamp dynamically to hql script in talend job

Hi All,

 

Please help me ASAP.

 

Thanks

Moderator

Re: Passing timestamp dynamically to hql script in talend job

Hello,

TalendDate.addDate(TalendDate.getCurrentDate(),"-20","dd") returns 20 days old date. Feel free to let us know if it is OK with you.

Sorry for our silence. We do our best to answer as many posts as possible.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now