|
81 | 81 | import java.io.File; |
82 | 82 | import java.io.IOException; |
83 | 83 | import java.util.ArrayList; |
| 84 | +import java.util.Comparator; |
84 | 85 | import java.util.HashMap; |
85 | | -import java.util.HashSet; |
86 | 86 | import java.util.LinkedHashMap; |
| 87 | +import java.util.LinkedHashSet; |
87 | 88 | import java.util.List; |
88 | 89 | import java.util.Map; |
89 | 90 | import java.util.Set; |
@@ -844,15 +845,18 @@ protected TsFileResource generateSingleAlignedSeriesFile( |
844 | 845 |
|
845 | 846 | protected List<IFullPath> getPaths(List<TsFileResource> resources) |
846 | 847 | throws IOException, IllegalPathException { |
847 | | - Set<IFullPath> paths = new HashSet<>(); |
| 848 | + Set<IFullPath> paths = new LinkedHashSet<>(); |
848 | 849 | try (MultiTsFileDeviceIterator deviceIterator = new MultiTsFileDeviceIterator(resources)) { |
849 | 850 | while (deviceIterator.hasNextDevice()) { |
850 | 851 | Pair<IDeviceID, Boolean> iDeviceIDBooleanPair = deviceIterator.nextDevice(); |
851 | 852 | IDeviceID deviceID = iDeviceIDBooleanPair.getLeft(); |
852 | 853 | boolean isAlign = iDeviceIDBooleanPair.getRight(); |
853 | 854 | Map<String, MeasurementSchema> schemaMap = deviceIterator.getAllSchemasOfCurrentDevice(); |
854 | 855 | IMeasurementSchema timeSchema = schemaMap.remove(TsFileConstant.TIME_COLUMN_ID); |
855 | | - List<IMeasurementSchema> measurementSchemas = new ArrayList<>(schemaMap.values()); |
| 856 | + List<IMeasurementSchema> measurementSchemas = |
| 857 | + schemaMap.values().stream() |
| 858 | + .sorted(Comparator.comparing(IMeasurementSchema::getMeasurementName)) |
| 859 | + .collect(Collectors.toList()); |
856 | 860 | if (measurementSchemas.isEmpty()) { |
857 | 861 | continue; |
858 | 862 | } |
|
0 commit comments