Github user denalex commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1353#discussion_r214413534
--- 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 --
this is counter-intuitive, a good guideline is to never change the meaning
of the user-set parameter. I would propose the following -- user provides value
of BATCH_SIZE:
1. nothing (not provided) -- use default of 100
2. 0 -- error out -- batch size of 0 does not make sense
3. 1 -- error out -- batch size of 1 does not make sense
4. < 1 -- error out -- batch size of <1 does not make sense
5. > 1 and < 65k -- use the number provided by the user
6. > 65k -- error out -- too large for practical purposes ?
---