drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] vdiravka commented on a change in pull request #1455: DRILL-6724: Convert IndexOutOfBounds exception to UserException with …
Date Tue, 04 Sep 2018 13:26:35 GMT
vdiravka commented on a change in pull request #1455: DRILL-6724: Convert IndexOutOfBounds
exception to UserException with …
URL: https://github.com/apache/drill/pull/1455#discussion_r214904295
 
 

 ##########
 File path: exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/json/JSONRecordReader.java
 ##########
 @@ -205,36 +191,32 @@ public int next() {
     writer.reset();
     recordCount = 0;
     parseErrorCount = 0;
-    if(write == ReadState.JSON_RECORD_PARSE_EOF_ERROR){
+    if (write == ReadState.JSON_RECORD_PARSE_EOF_ERROR) {
       return recordCount;
     }
-    outside: while(recordCount < DEFAULT_ROWS_PER_BATCH){
-      try{
+    while (recordCount < DEFAULT_ROWS_PER_BATCH) {
+      try {
         writer.setPosition(recordCount);
         write = jsonReader.write(writer);
-        if(write == ReadState.WRITE_SUCCEED){
+        if (write == ReadState.WRITE_SUCCEED) {
           recordCount++;
-        }
-        else if(write == ReadState.JSON_RECORD_PARSE_ERROR || write == ReadState.JSON_RECORD_PARSE_EOF_ERROR){
-          if(skipMalformedJSONRecords == false){
-            handleAndRaise("Error parsing JSON", new Exception(hadoopPath.getName() + " :
line nos :" + (recordCount+1)));
+        } else if (write == ReadState.JSON_RECORD_PARSE_ERROR || write == ReadState.JSON_RECORD_PARSE_EOF_ERROR)
{
+          if (!skipMalformedJSONRecords) {
+            handleAndRaise("Error parsing JSON", new Exception());
           }
           ++parseErrorCount;
-          if(printSkippedMalformedJSONRecordLineNumber){
-            logger.debug("Error parsing JSON in " + hadoopPath.getName() + " : line nos :"
+ (recordCount+parseErrorCount));
+          if (printSkippedMalformedJSONRecordLineNumber) {
+            logger.debug("Error parsing JSON in " + hadoopPath.getName() + " : line nos :"
+ (recordCount + parseErrorCount));
 
 Review comment:
   spaces near `+` operator

----------------------------------------------------------------
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

Mime
View raw message