Skip to content

Commit

Permalink
remove dead code
Browse files Browse the repository at this point in the history
Signed-off-by: Murphy <mofei@starrocks.com>
  • Loading branch information
murphyatwork committed Oct 24, 2024
1 parent 197f9d7 commit 8dd3041
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@

package com.starrocks.sql.optimizer.statistics;

import org.jetbrains.annotations.NotNull;

import java.util.Objects;

public class Bucket implements Comparable<Bucket> {
public class Bucket {
private final double lower;
private final double upper;
private final Long count;
Expand Down Expand Up @@ -48,19 +46,6 @@ public Long getUpperRepeats() {
return upperRepeats;
}

public boolean isOverlapped(Bucket other) {
return Math.min(upper, other.upper) - Math.max(lower, other.lower) >= 0;
}

@Override
public int compareTo(@NotNull Bucket o) {
int lowerComparison = Double.compare(this.lower, o.lower);
if (lowerComparison != 0) {
return lowerComparison;
}
return Double.compare(this.upper, o.upper);
}

@Override
public boolean equals(Object o) {
if (this == o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,6 @@ public double overlapPercentWith(@NotNull StatisticRangeValues other) {
return StatisticsEstimateCoefficient.OVERLAP_INFINITE_RANGE_FILTER_COEFFICIENT;
}

double overlapLength(StatisticRangeValues other) {
if (this.isEmpty() || other.isEmpty()) {
return 0.0;
}
// If the low and high values is infinite, it represents either string type or unknown of column statistics.
if (this.equals(other) && !isBothInfinite()) {
return 1.0;
}

double lengthOfIntersect = min(this.high, other.high) - max(this.low, other.low);
return lengthOfIntersect;
}

public StatisticRangeValues intersect(StatisticRangeValues other) {
double newLow = max(low, other.low);
double newHigh = min(high, other.high);
Expand Down

0 comments on commit 8dd3041

Please sign in to comment.