Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

Assign variable to the query results in Impala

avatar
Visitor

I am trying to assign a value to a variable using single value result from a query but i keep getting syntax error . I am using HUE - Impala Editor 

Result of "Select distinct MonthEndSnapshotKey FROM vmge_1h_bmh_lynx_non_pu_sec.rundtcur" = 202005 with data type INT .

I want to assign it to variable Testvar 

 

SQL statements : 

SET $(testvar=Select distinct MonthEndSnapshotKey FROM vmge_1h_bmh_lynx_non_pu_sec.rundtcur};

select $(testvar}

  • ParseException: Syntax error in line 1:undefined: SET $(testvar=Select distinct Mon... ^ Encountered: ( Expected: = CAUSED BY: Exception: Syntax error
1 REPLY 1

avatar
Expert Contributor

Hi @SDPLearner Can you please check and confirm if it works using impala-shell or not.