QiangCai commented on a change in pull request #3535: [WIP] Refactory data 
loading for partition table
URL: https://github.com/apache/carbondata/pull/3535#discussion_r361888358
 
 

 ##########
 File path: 
hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonOutputCommitter.java
 ##########
 @@ -222,6 +215,91 @@ public void commitJob(JobContext context) throws 
IOException {
     }
   }
 
+  private void commitJobFinal(JobContext context, CarbonLoadModel loadModel,
+      OperationContext operationContext, CarbonTable carbonTable, String 
uniqueId)
+      throws IOException {
+    DataMapStatusManager.disableAllLazyDataMaps(carbonTable);
+    if (operationContext != null) {
+      LoadEvents.LoadTablePostStatusUpdateEvent postStatusUpdateEvent =
+          new LoadEvents.LoadTablePostStatusUpdateEvent(loadModel);
+      try {
+        OperationListenerBus.getInstance()
+            .fireEvent(postStatusUpdateEvent, operationContext);
+      } catch (Exception e) {
+        throw new IOException(e);
+      }
+    }
+    String updateTime =
+        
context.getConfiguration().get(CarbonTableOutputFormat.UPADTE_TIMESTAMP, null);
+    String segmentsToBeDeleted =
+        
context.getConfiguration().get(CarbonTableOutputFormat.SEGMENTS_TO_BE_DELETED, 
"");
+    List<Segment> segmentDeleteList = 
Segment.toSegmentList(segmentsToBeDeleted.split(","), null);
+    Set<Segment> segmentSet = new HashSet<>(
+        new SegmentStatusManager(carbonTable.getAbsoluteTableIdentifier(),
+            
context.getConfiguration()).getValidAndInvalidSegments(carbonTable.isChildTableForMV())
+            .getValidSegments());
+    if (updateTime != null) {
+      CarbonUpdateUtil.updateTableMetadataStatus(segmentSet, carbonTable, 
updateTime, true,
+          segmentDeleteList);
+    } else if (uniqueId != null) {
+      CarbonUpdateUtil.updateTableMetadataStatus(segmentSet, carbonTable, 
uniqueId, true,
+          segmentDeleteList);
+    }
+  }
+
+  private void commitJobForPartition(JobContext context, boolean overwriteSet,
 
 Review comment:
   done

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to