hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eugene Koifman <ekoif...@hortonworks.com>
Subject Re: Update operation on hive table using Join
Date Mon, 17 Oct 2016 18:18:45 GMT
This is not supported.  The same can be achieved using Merge statement which is WIP: https://issues.apache.org/jira/browse/HIVE-10924.

Eugene

From: Priyanka Raghuvanshi <PriyankaR@winjit.com<mailto:PriyankaR@winjit.com>>
Reply-To: "user@hive.apache.org<mailto:user@hive.apache.org>" <user@hive.apache.org<mailto:user@hive.apache.org>>
Date: Monday, October 17, 2016 at 2:14 AM
To: "user@hive.apache.org<mailto:user@hive.apache.org>" <user@hive.apache.org<mailto:user@hive.apache.org>>
Subject: Update operation on hive table using Join

Hi,

Is there any way to  update a Hive table with join.
Following is the query :

SQL query

UPDATE _STCC_CurrentLocationMaPData
set [Address]=replace(CL.cOut_Event_Description,'''''''',''''),
[Latitude]=CL.fOut_latitude ,
[Longitude]=CL.fOut_longitude ,
[Speed] =CL.fOut_Speed,
[dTimeStamp] =MV.dTimeStamp,
[Reg_No]=CL.cOut_registration,
[GPSState] = CL.bGPS
FROM  #MaxValues MV
INNER JOIN CartrackDetailsInfo CL on MV.dTimeStamp=CL.dTimeStamp AND MV.AcqAccountNumber=CL.AcqAccountNumber
INNER JOIN  _STCC_CurrentLocationMaPData CLR on MV.AcqAccountNumber=CLR.AccountNo
where CLR.AccountNo=MV.AcqAccountNumber


HQL query
UPDATE current_location set address=regexp_replace(cl.cout_event_description,'''''''',''''),latitude=cl.latitude,longitude=cl.longitude
,speed =cl.speed,dtimestamp =mv.dtimestamp,reg_no=cl.registration,gpsstate = cl.bgps
FROM  default.maxvalues mv
INNER JOIN cartrackdetailsinfo cl on mv.dtimestamp=cl.dtimestamp ANDmv.acqaccountnumber=cl.acqaccountnumber
INNER JOIN current_location clr on mv.acqaccountnumber=clr.deal_number
where clr.deal_number=mv.acqaccountnumber;
Output
FAILED: ParseException line 1:221 missing EOF at 'FROM' near 'bgps






Mime
View raw message