[GitHub] [carbondata] akashrn5 commented on a change in pull request #3226: [CARBONDATA-3393] Merge Index Job Failure should not trigger the merge index job again. Exception should be propagated to the caller.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] akashrn5 commented on a change in pull request #3226: [CARBONDATA-3393] Merge Index Job Failure should not trigger the merge index job again. Exception should be propagated to the caller.

GitBox
akashrn5 commented on a change in pull request #3226: [CARBONDATA-3393] Merge Index Job Failure should not trigger the merge index job again. Exception should be propagated to the caller.
URL: https://github.com/apache/carbondata/pull/3226#discussion_r285880463
 
 

 ##########
 File path: integration/spark-common/src/main/scala/org/apache/spark/rdd/CarbonMergeFilesRDD.scala
 ##########
 @@ -82,19 +84,33 @@ object CarbonMergeFilesRDD {
             readFileFooterFromCarbonDataFile).collect()
         }
       } catch {
-        case _: Exception =>
-          if (CarbonCommonConstants.CARBON_MERGE_INDEX_IN_SEGMENT_DEFAULT.toBoolean) {
-            new CarbonMergeFilesRDD(
-              sparkSession,
-              carbonTable,
-              segmentIds,
-              segmentFileNameToSegmentIdMap,
-              carbonTable.isHivePartitionTable,
-              readFileFooterFromCarbonDataFile).collect()
-          }
+        case ex: Exception =>
+          val message = "Merge Index files request is failed " +
+                        s"for table ${ carbonTable.getTableUniqueName }" + ex.getMessage
+          LOGGER.error(message)
+          throw new RuntimeException(message, ex)
       }
     }
   }
+
+  /**
+   * Check whether the Merge Index Property is set by the user.
+   * If not set, take the default value of the property.
+   *
+   * @return
+   */
+  def isMergeIndexPropertySet: Boolean = {
+    var mergeIndex: Boolean = false
+    try {
+      mergeIndex = CarbonProperties.getInstance().getProperty(
+        CarbonCommonConstants.CARBON_MERGE_INDEX_IN_SEGMENT,
+        CarbonCommonConstants.CARBON_MERGE_INDEX_IN_SEGMENT_DEFAULT).toBoolean
+    } catch {
+      case _ =>
 
 Review comment:
   instead of just a case, better to define type of case, as Exception

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


With regards,
Apache Git Services