Options
- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Assign variable to the query results in Impala
Labels:
- Labels:
-
Cloudera Hue
Visitor
Created 04-28-2022 08:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Expert Contributor
Created 02-21-2024 08:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @SDPLearner Can you please check and confirm if it works using impala-shell or not.