Skip to content

Commit

Permalink
[fix](stats) sort partitions when do sample analyze (apache#32185)
Browse files Browse the repository at this point in the history
  • Loading branch information
freemandealer authored and seawinde committed Mar 20, 2024
1 parent f6b6723 commit ea1daa2
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -255,7 +256,9 @@ protected Pair<List<Long>, Long> calcActualSampleTablets(boolean forPartitionCol
List<Long> sampleTabletIds = new ArrayList<>();
long actualSampledRowCount = 0;
boolean enough = false;
for (Partition p : olapTable.getPartitions()) {
List<Partition> sortedPartitions = olapTable.getPartitions().stream().sorted(
Comparator.comparing(Partition::getName)).collect(Collectors.toList());
for (Partition p : sortedPartitions) {
MaterializedIndex materializedIndex = info.indexId == -1 ? p.getBaseIndex() : p.getIndex(info.indexId);
if (materializedIndex == null) {
continue;
Expand Down

0 comments on commit ea1daa2

Please sign in to comment.