- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to use Hive update with select statement to SET a column Value
- Labels:
-
Apache Hive
Created ‎09-21-2018 08:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can anyone tell me what's wrong in this query ?
UPDATE tableA SET submitted_from_ip=(SELECT vqs.fieldvalue FROM viewA vqs join tableA fqs on vqs.formid=fqs.formid AND vqs.SubmitTime=fqs.submit_time WHERE vqs.fieldname='submitted_from_ip') JOIN tableA fqs on vqs.formid=fqs.formid AND vqs.SubmitTime=fqs.submit_time WHERE vqs.fieldname='submitted_from_ip';
Created ‎09-22-2018 02:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Update <table_name> Set <col_name>=(<Query>) is not possible with Hive.
Update <table_name> Set <col_name>="<value>" is possible with Hive.
You could try using Hive ACID Merge approach to update the values But not sure is merge will work with setting out values based on the query.
Created ‎09-22-2018 10:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Glad to hear that.. 🙂
Could you Click on Accept button below to accept the answer to close the thread as accepted, That would be great help to Community users to find solution quickly for these kind of issues.
Created ‎09-22-2018 09:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you @Shu
Hive Merge approach worked for my case.
