Re: Hive variable behaviour

2021-11-30 Thread Pau Tallada
Hi, Note that CURRENT_TIMESTAMP is only evaluated once, when you assign to the variable. Why not using something like: set hivevar:start_tm=current_timestamp; select ${hivevar:start_tm}; select query; select CURRENT_TIMESTAMP; Cheers, Pau. Missatge de Zoltan Haindrich del dia dt., 30 de

Re: Hive variable behaviour

2021-11-30 Thread Zoltan Haindrich
Hey Elango! Variables are not evaluated at assignment time - instead they are evaluated at the time of usage. If you want to save the current time somehow I think you could: * put the current_timestamp into a temporary table: create temporary table start_time as select current_timestamp() as

Re: Hive variable behaviour

2021-11-29 Thread elango vaidyanathan
Hi All, any updates on this? Thanks, Elango On Fri, Nov 26, 2021, 11:09 AM elango vaidyanathan wrote: > > Hi all, > > I am trying to create a hive variable and store the current time stamp. > Then run some complex select queries and then create another variable to > store current timestamp and

Hive variable behaviour

2021-11-25 Thread elango vaidyanathan
Hi all, I am trying to create a hive variable and store the current time stamp. Then run some complex select queries and then create another variable to store current timestamp and then find the runtime. The problem I am facing is every time I use the variable it gives me the current time instead