You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by ravipesala <gi...@git.apache.org> on 2018/07/30 15:05:33 UTC

[GitHub] carbondata pull request #2587: [CARBONDATA-2806] Delete delete delta files u...

GitHub user ravipesala opened a pull request:

    https://github.com/apache/carbondata/pull/2587

    [CARBONDATA-2806] Delete delete delta files upon clean files for flat folder

    Problem: 
    Delete delta files are not removed after clean files operation.
    Solution: 
    Get the delta files using Segment Status Manager and remove them during clean operation.
    
    Be sure to do all of the following checklist to help us incorporate 
    your contribution quickly and easily:
    
     - [ ] Any interfaces changed?
     
     - [ ] Any backward compatibility impacted?
     
     - [ ] Document update required?
    
     - [ ] Testing done
            Please provide details on 
            - Whether new unit test cases have been added or why no new tests are required?
            - How it is tested? Please attach test report.
            - Is it a performance related change? Please attach the performance test report.
            - Any additional information to help reviewers in testing this change.
           
     - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA. 
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ravipesala/incubator-carbondata flat-folder-delete-delta

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/carbondata/pull/2587.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2587
    
----
commit ebb9a68b0048351adbb27ec7fc4068bdd0b872c5
Author: ravipesala <ra...@...>
Date:   2018-07-30T15:00:58Z

    Delete delete delta files upon clean files

----


---

[GitHub] carbondata issue #2587: [CARBONDATA-2806] Delete delete delta files upon cle...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/2587
  
    retest this please


---

[GitHub] carbondata pull request #2587: [CARBONDATA-2806] Delete delete delta files u...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2587#discussion_r206419167
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java ---
    @@ -793,25 +794,31 @@ public static void cleanSegments(CarbonTable table, List<PartitionSpec> partitio
       /**
        * Deletes the segment file and its physical files like partition folders from disk
        * @param tablePath
    -   * @param segmentFile
    +   * @param segment
        * @param partitionSpecs
        * @throws IOException
        */
    -  public static void deleteSegment(String tablePath, String segmentFile,
    -      List<PartitionSpec> partitionSpecs) throws IOException {
    -    SegmentFileStore fileStore = new SegmentFileStore(tablePath, segmentFile);
    +  public static void deleteSegment(String tablePath, Segment segment,
    +      List<PartitionSpec> partitionSpecs,
    +      SegmentUpdateStatusManager updateStatusManager) throws Exception {
    +    SegmentFileStore fileStore = new SegmentFileStore(tablePath, segment.getSegmentFileName());
         List<String> indexOrMergeFiles = fileStore.readIndexFiles(SegmentStatus.SUCCESS, true);
         Map<String, List<String>> indexFilesMap = fileStore.getIndexFilesMap();
         for (Map.Entry<String, List<String>> entry : indexFilesMap.entrySet()) {
           FileFactory.deleteFile(entry.getKey(), FileFactory.getFileType(entry.getKey()));
           for (String file : entry.getValue()) {
    +        String[] deltaFilePaths =
    +            updateStatusManager.getDeleteDeltaFilePath(file, segment.getSegmentNo());
    +        for (String deltaFilePath : deltaFilePaths) {
    +          FileFactory.deleteFile(deltaFilePath, FileFactory.getFileType(deltaFilePath));
    +        }
             FileFactory.deleteFile(file, FileFactory.getFileType(file));
           }
         }
         deletePhysicalPartition(partitionSpecs, indexFilesMap, indexOrMergeFiles, tablePath);
         String segmentFilePath =
             CarbonTablePath.getSegmentFilesLocation(tablePath) + CarbonCommonConstants.FILE_SEPARATOR
    --- End diff --
    
    ok


---

[GitHub] carbondata issue #2587: [CARBONDATA-2806] Delete delete delta files upon cle...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2587
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/7654/



---

[GitHub] carbondata issue #2587: [CARBONDATA-2806] Delete delete delta files upon cle...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2587
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/7659/



---

[GitHub] carbondata issue #2587: [CARBONDATA-2806] Delete delete delta files upon cle...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2587
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/7626/



---

[GitHub] carbondata issue #2587: [CARBONDATA-2806] Delete delete delta files upon cle...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/2587
  
    retest this please


---

[GitHub] carbondata issue #2587: [CARBONDATA-2806] Delete delete delta files upon cle...

Posted by brijoobopanna <gi...@git.apache.org>.
Github user brijoobopanna commented on the issue:

    https://github.com/apache/carbondata/pull/2587
  
    retest sdv please



---

[GitHub] carbondata issue #2587: [CARBONDATA-2806] Delete delete delta files upon cle...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/2587
  
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/6090/



---

[GitHub] carbondata issue #2587: [CARBONDATA-2806] Delete delete delta files upon cle...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/2587
  
    retest sdv please


---

[GitHub] carbondata pull request #2587: [CARBONDATA-2806] Delete delete delta files u...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/carbondata/pull/2587


---

[GitHub] carbondata issue #2587: [CARBONDATA-2806] Delete delete delta files upon cle...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2587
  
    Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/6388/



---

[GitHub] carbondata pull request #2587: [CARBONDATA-2806] Delete delete delta files u...

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2587#discussion_r206410979
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java ---
    @@ -793,25 +794,31 @@ public static void cleanSegments(CarbonTable table, List<PartitionSpec> partitio
       /**
        * Deletes the segment file and its physical files like partition folders from disk
        * @param tablePath
    -   * @param segmentFile
    +   * @param segment
        * @param partitionSpecs
        * @throws IOException
        */
    -  public static void deleteSegment(String tablePath, String segmentFile,
    -      List<PartitionSpec> partitionSpecs) throws IOException {
    -    SegmentFileStore fileStore = new SegmentFileStore(tablePath, segmentFile);
    +  public static void deleteSegment(String tablePath, Segment segment,
    +      List<PartitionSpec> partitionSpecs,
    +      SegmentUpdateStatusManager updateStatusManager) throws Exception {
    +    SegmentFileStore fileStore = new SegmentFileStore(tablePath, segment.getSegmentFileName());
         List<String> indexOrMergeFiles = fileStore.readIndexFiles(SegmentStatus.SUCCESS, true);
         Map<String, List<String>> indexFilesMap = fileStore.getIndexFilesMap();
         for (Map.Entry<String, List<String>> entry : indexFilesMap.entrySet()) {
           FileFactory.deleteFile(entry.getKey(), FileFactory.getFileType(entry.getKey()));
           for (String file : entry.getValue()) {
    +        String[] deltaFilePaths =
    +            updateStatusManager.getDeleteDeltaFilePath(file, segment.getSegmentNo());
    +        for (String deltaFilePath : deltaFilePaths) {
    +          FileFactory.deleteFile(deltaFilePath, FileFactory.getFileType(deltaFilePath));
    +        }
             FileFactory.deleteFile(file, FileFactory.getFileType(file));
           }
         }
         deletePhysicalPartition(partitionSpecs, indexFilesMap, indexOrMergeFiles, tablePath);
         String segmentFilePath =
             CarbonTablePath.getSegmentFilesLocation(tablePath) + CarbonCommonConstants.FILE_SEPARATOR
    --- End diff --
    
    suggest to add a function in CarbonTablePath to get the segmentFilePath instead of constructing it here


---

[GitHub] carbondata pull request #2587: [CARBONDATA-2806] Delete delete delta files u...

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2587#discussion_r206411205
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/DeleteLoadFolders.java ---
    @@ -75,21 +76,21 @@ public static void physicalFactAndMeasureMetadataDeletion(
             absoluteTableIdentifier,
             currentDetails,
             isForceDelete,
    -        specs);
    +        specs,
    +        currentDetails);
         if (newAddedLoadHistoryList != null && newAddedLoadHistoryList.length > 0) {
           physicalFactAndMeasureMetadataDeletion(
               absoluteTableIdentifier,
               newAddedLoadHistoryList,
               isForceDelete,
    -          specs);
    +          specs,
    +          currentDetails);
         }
       }
     
    -  public static void physicalFactAndMeasureMetadataDeletion(
    -      AbsoluteTableIdentifier absoluteTableIdentifier,
    -      LoadMetadataDetails[] loadDetails,
    -      boolean isForceDelete,
    -      List<PartitionSpec> specs) {
    +  private static void physicalFactAndMeasureMetadataDeletion(
    +      AbsoluteTableIdentifier absoluteTableIdentifier, LoadMetadataDetails[] loadDetails,
    --- End diff --
    
    Can you add comment to describe what is loadDetails and currLoadDetails?


---

[GitHub] carbondata issue #2587: [CARBONDATA-2806] Delete delete delta files upon cle...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2587
  
    Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/6349/



---

[GitHub] carbondata issue #2587: [CARBONDATA-2806] Delete delete delta files upon cle...

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on the issue:

    https://github.com/apache/carbondata/pull/2587
  
    LGTM


---

[GitHub] carbondata pull request #2587: [CARBONDATA-2806] Delete delete delta files u...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2587#discussion_r206420686
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/DeleteLoadFolders.java ---
    @@ -75,21 +76,21 @@ public static void physicalFactAndMeasureMetadataDeletion(
             absoluteTableIdentifier,
             currentDetails,
             isForceDelete,
    -        specs);
    +        specs,
    +        currentDetails);
         if (newAddedLoadHistoryList != null && newAddedLoadHistoryList.length > 0) {
           physicalFactAndMeasureMetadataDeletion(
               absoluteTableIdentifier,
               newAddedLoadHistoryList,
               isForceDelete,
    -          specs);
    +          specs,
    +          currentDetails);
         }
       }
     
    -  public static void physicalFactAndMeasureMetadataDeletion(
    -      AbsoluteTableIdentifier absoluteTableIdentifier,
    -      LoadMetadataDetails[] loadDetails,
    -      boolean isForceDelete,
    -      List<PartitionSpec> specs) {
    +  private static void physicalFactAndMeasureMetadataDeletion(
    +      AbsoluteTableIdentifier absoluteTableIdentifier, LoadMetadataDetails[] loadDetails,
    --- End diff --
    
    ok


---

[GitHub] carbondata issue #2587: [CARBONDATA-2806] Delete delete delta files upon cle...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/2587
  
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/6069/



---

[GitHub] carbondata issue #2587: [CARBONDATA-2806] Delete delete delta files upon cle...

Posted by brijoobopanna <gi...@git.apache.org>.
Github user brijoobopanna commented on the issue:

    https://github.com/apache/carbondata/pull/2587
  
    retest this please


---

[GitHub] carbondata issue #2587: [CARBONDATA-2806] Delete delete delta files upon cle...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2587
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/7646/



---

[GitHub] carbondata issue #2587: [CARBONDATA-2806] Delete delete delta files upon cle...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2587
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/7632/



---

[GitHub] carbondata issue #2587: [CARBONDATA-2806] Delete delete delta files upon cle...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2587
  
    Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/6372/



---