[GitHub] [carbondata] kunal642 commented on a change in pull request #3431: [CARBONDATA-3566] Support add segment for partition table

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

[GitHub] [carbondata] kunal642 commented on a change in pull request #3431: [CARBONDATA-3566] Support add segment for partition table

GitBox
kunal642 commented on a change in pull request #3431: [CARBONDATA-3566] Support add segment for partition table
URL: https://github.com/apache/carbondata/pull/3431#discussion_r346226942
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java
 ##########
 @@ -230,23 +231,36 @@ public static boolean writeSegmentFile(CarbonTable carbonTable, Segment segment)
     return false;
   }
 
-  public static boolean writeSegmentFileForOthers(CarbonTable carbonTable, Segment segment)
+  public static boolean writeSegmentFileForOthers(
+      CarbonTable carbonTable,
+      Segment segment,
+      PartitionSpec partitionSpec,
+      List<FileStatus> partitionDataFiles)
       throws IOException {
     String tablePath = carbonTable.getTablePath();
-    CarbonFile segmentFolder = FileFactory.getCarbonFile(segment.getSegmentPath());
-    CarbonFile[] otherFiles = segmentFolder.listFiles(new CarbonFileFilter() {
-      @Override public boolean accept(CarbonFile file) {
-        return (!file.getName().equals("_SUCCESS") && !file.getName().endsWith(".crc"));
-      }
-    });
-    if (otherFiles != null && otherFiles.length > 0) {
+    CarbonFile[] dataFiles = null;
+    if (partitionDataFiles.isEmpty()) {
+      CarbonFile segmentFolder = FileFactory.getCarbonFile(segment.getSegmentPath());
+      dataFiles = segmentFolder.listFiles(
+          file -> (!file.getName().equals("_SUCCESS") && !file.getName().endsWith(".crc")));
 
 Review comment:
   Then let us change the java version for all the modules. Can you handle in this PR?

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