You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Damien Carol (JIRA)" <ji...@apache.org> on 2013/11/28 18:16:37 UTC
[jira] [Updated] (PIG-3597) Enable piggybank DBStorage to store to
JDBC databases without Batch Statement support
[ https://issues.apache.org/jira/browse/PIG-3597?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Damien Carol updated PIG-3597:
------------------------------
Tags: (was: io jdbc sql pig)
Labels: io jdbc jdbcstorage pig piggybank (was: )
> 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
> Labels: io, jdbc, jdbcstorage, pig, piggybank
>
> 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)