Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyiZzz committed Nov 6, 2023
1 parent 27ff51c commit c5b7ca1
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -948,9 +948,11 @@ public void computeSampleTabletIds() {
}
for (Long partitionId : selectedPartitionIds) {
final Partition partition = olapTable.getPartition(partitionId);
final MaterializedIndex selectedTable = partition.getIndex(selectedIndexId);
selectedRows += selectedTable.getRowCount();
selectedPartitionList.add(partitionId);
final MaterializedIndex selectedIndex = partition.getIndex(selectedIndexId);
if (selectedIndex != null) {
selectedRows += selectedIndex.getRowCount();
selectedPartitionList.add(partitionId);
}
}
selectedPartitionList.sort(Comparator.naturalOrder());

Expand All @@ -970,7 +972,7 @@ public void computeSampleTabletIds() {
// 3. Sampling partition. If Seek is specified, the partition will be the same for each sampling.
long hitRows = 0; // The number of rows hit by the tablet
long partitionSeek = tableSample.getSeek() != -1
? tableSample.getSeek() : (long) (new SecureRandom().nextDouble() * selectedPartitionIds.size());
? tableSample.getSeek() : (long) (new SecureRandom().nextDouble() * selectedPartitionList.size());
for (int i = 0; i < selectedPartitionList.size(); i++) {
int seekPid = (int) ((i + partitionSeek) % selectedPartitionList.size());
final Partition partition = olapTable.getPartition(selectedPartitionList.get(seekPid));
Expand Down

0 comments on commit c5b7ca1

Please sign in to comment.