Github user denalex commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1353#discussion_r214444738
  
    --- Diff: 
pxf/pxf-jdbc/src/main/java/org/apache/hawq/pxf/plugins/jdbc/writercallable/WriterCallableFactory.java
 ---
    @@ -75,16 +75,15 @@ public void setQuery(String query) {
         /**
          * Set batch size to use.
          *
    -     * @param batchSize < 0: Use batches of infinite size
    +     * @param batchSize = 0: Use batches of recommended size
          * @param batchSize = 1: Do not use batches
          * @param batchSize > 1: Use batches of the given size
    +     * @param batchSize < 0: Use batches of infinite size
          */
         public void setBatchSize(int batchSize) {
    -        if (batchSize < 0) {
    -            batchSize = 0;
    -        }
    -        else if (batchSize == 0) {
    -            batchSize = 1;
    +        if (batchSize == 0) {
    +            // Set the recommended value: 
https://docs.oracle.com/cd/E11882_01/java.112/e16548/oraperf.htm#JJDBC28754
    +            batchSize = 100;
    --- End diff --
    
    oh, thanks, got it, I thought batch on/off was a separate property. If we 
want to stick with a single property (and keep it simple for users), then I 
think using batching by default (with a default value) is a good idea (if the 
backend db supports it). This way, though, we will have to let users to turn it 
off for a query, which they will achieve by setting the value to 0 (batch 
feature is off) or 1 (batch with size 1 practically means no batching, 
implementation can take care of that). I think this is closer to your original 
design, except I would take out negative values to prohibit unlimited size, as 
well as maybe put an upper bound on batch size to prevent crashing PXF with OOM.


---

Reply via email to