天天看點

spark操作mysql出現不可重複如何處理?ON DUPLICATE KEY UPDATE

INSERT INTO tb_http_tomcat_monitor_1 (id,total_res_time,total_req_count,req_dispose_count,queue_size,thread_pool_size,excute_thread_count,wait_thread_count)
VALUES('20180810093055',20,1,2,1,20,2,1) ON DUPLICATE KEY UPDATE total_res_time=total_res_time+VALUES(total_res_time),total_req_count=total_req_count+VALUES(total_req_count)
           

INSERT INTO tbl (columnA,columnB,columnC) VALUES (1,2,3) ON DUPLICATE KEY UPDATE columnA=IF(columnB>0,1,columnA)

spark操作mysql出現不可重複如何處理?ON DUPLICATE KEY UPDATE

繼續閱讀