Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

How to use DBStorage with Mysql update command?

$
0
0
Hi guys,

Please tell me how to use DBStorage with Mysql update command like command
below:

STORE RESULT INTO '/data/result' USING
org.apache.pig.piggybank.storage.DBStorage('com.mysql.jdbc.Driver','jdbc:mysql://
192.168.1.1:3306/app','bigdata','bigdata','UPDATE app_statistic SET
num=num+$1 WHERE app_id=$0');

or

org.apache.pig.piggybank.storage.DBStorage('com.mysql.jdbc.Driver','jdbc:mysql://
192.168.1.1:3306/app','bigdata','bigdata','INSERT INTO app_statistic
(app_id,num) VALUES (?,?) ON DUPLICATE KEY UPDATE num=num+$1');

many thanks, please.

*Pham Phuong TuBack-end Big data developerSkype: phamphuongtu*

Viewing all articles
Browse latest Browse all 5648

Trending Articles