jackylk 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_r345158806
##########
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:
For CarbonData 2.0, we should change to use java 1.8, and this does not
impact user code in client side
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services