You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2019/01/18 03:13:16 UTC

[GitHub] kumarvishal09 commented on a change in pull request #3070: [CARBONDATA-3246]Fix sdk reader issue if batch size is given as zero and vectorRead False.

kumarvishal09 commented on a change in pull request #3070: [CARBONDATA-3246]Fix sdk reader issue if batch size is given as zero and vectorRead False.
URL: https://github.com/apache/carbondata/pull/3070#discussion_r248916111
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/util/CarbonProperties.java
 ##########
 @@ -1523,5 +1529,31 @@ private void validateStringCharacterLimit() {
     }
   }
 
-
+  /**
+   * This method validates the DETAIL_QUERY_BATCH_SIZE. If some invalid input is set, we use the
+   * default value for this property
+   */
+  private void validateDetailQueryBatchSize() {
+    String batchSizeString =
+        carbonProperties.getProperty(CarbonCommonConstants.DETAIL_QUERY_BATCH_SIZE);
+    if (batchSizeString == null) {
+      carbonProperties.setProperty(DETAIL_QUERY_BATCH_SIZE,
+          Integer.toString(CarbonCommonConstants.DETAIL_QUERY_BATCH_SIZE_DEFAULT));
+      LOGGER.info(
+          "Using default value for carbon.detail.batch.size " + DETAIL_QUERY_BATCH_SIZE_DEFAULT);
+    } else {
+      int batchSize;
+      try {
+        batchSize = Integer.parseInt(batchSizeString);
+        if (batchSize < 100 || batchSize > 1000) {
+          throw new NumberFormatException();
 
 Review comment:
   Why you are throwing exception if batch size value is not in the range of min max then use default value and add a log 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services