Damien Carol created PIG-3597:
---------------------------------
Summary: Enable piggybank DBStorage to store to JDBC databases
without Batch Statement support
Key: PIG-3597
URL: https://issues.apache.org/jira/browse/PIG-3597
Project: Pig
Issue Type: Bug
Components: piggybank
Affects Versions: 0.12.0
Reporter: Damien Carol
There are no option to turning batching off with this storage.
Some exotic JDBC driver doesn't provide Batch Statement implementation.
{code:title=org.apache.pig.piggybank.storage.DBStorage.java:157|borderStyle=solid}
this.ps.addBatch();
this.count += 1;
if (this.count > this.batchSize) {
this.count = 0;
this.ps.executeBatch();
this.ps.clearBatch();
this.ps.clearParameters();
}
{code}
An easy fix is to use DatabaseMetaData.supportsBatchUpdates() in JDBC.
And to use only ps.execute() if the JDBC driver doesn't support Batch Statement.
--
This message was sent by Atlassian JIRA
(v6.1#6144)