hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Priyanka Raghuvanshi" <Priyan...@winjit.com>
Subject Update operation on hive table using Join
Date Mon, 17 Oct 2016 09:14:57 GMT
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