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

    https://github.com/apache/hawq/pull/1353#discussion_r215023775
  
    --- Diff: pxf/pxf-jdbc/README.md ---
    @@ -114,14 +114,13 @@ The `PARTITION_BY`, `RANGE` and `INTERVAL` parameters 
in such tables are ignored
     INSERT queries can be batched. This may significantly increase perfomance 
if batching is supported by an external database.
     
     To enable batching, create an external table with the parameter 
`BATCH_SIZE` set to:
    -* `0`. Batch will be of 
[recommended](https://docs.oracle.com/cd/E11882_01/java.112/e16548/oraperf.htm#JJDBC28754)
 size (`100`);
    -* `1`. Batching will not be used;
    -* `integer > 1`. Batches of the given size will be used;
    -* `integer < 0`. A batch of infinite size will be used (all tuples will be 
sent in one huge JDBC query from each segment). Choosing this value **may cause 
errors**, as PXF will consume lots of memory; also, every database has a limit 
on the maximum size of JDBC queries.
    +* `integer < 1`. Batch will be of 
[recommended](https://docs.oracle.com/cd/E11882_01/java.112/e16548/oraperf.htm#JJDBC28754)
 size (`100`);
    --- End diff --
    
    Changing the batch size value after it is being explicitly specified by the 
user seems wrong. I suggest we should throw an exception if the specified batch 
size is a negative integer. We should use the default of 100 only if the batch 
size was never specified. Both 0, and 1 should result in no batching. Right 
now, batch size 0 will result as batch size 100, which is not what we want. 
Here is the desirable chart:
    
    If external database supports batching:
    ```
    * Not specified: Batch will be of recommended size(100)
    * 0 or 1: Do not use batching
    * > 1 : Use the specified size
    * Anything else: Error out that the batch size is invalid
    ```
    
    If the external database does not support batching:
    ```
    * Not specified: Do not use batching
    * 0 or 1: Do not use batching
    * > 1 : Error out stating the external database does not support batching
    * Anything else: Error out that the batch size is invalid
    ```


---

Reply via email to