Hi It seems (see here <https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/Driver.java#L388>) Hive substitutes the variables before parsing the query. So the query being parsed is actually:
SELECT criticid AS criticid, sum(rating) as rating, 0= 0 + 1 AS R_N_1 ... Once the constants are folded, I expect it becomes: SELECT criticid AS criticid, sum(rating) as rating, false AS R_N_1 ... hth GB On 6/5/2015 7:22 AM, Ravisankar Mani wrote:
Hi everyone, I assign values for set variable. Please refer following query SET Row_Number_0 = 0; SELECT criticid AS criticid, sum(rating) as rating, ${hiveconf:Row_Number_0}= ${hiveconf:Row_Number_0} + 1 AS R_N_1 FROM GROUP BY recommend_ratings2.criticid ORDER BY criticid ASC; the assign variable(3 or select values) only returns true or false But the same query returns 1,2,3......... (row number) in mysql. Could you please help exact query to return assign values? Regards, Ravisankar M R
-- The statements and opinions expressed here are my own and do not necessarily represent those of Oracle Corporation.