Skip to content

Commit

Permalink
Fix value filter allSatisfy bug
Browse files Browse the repository at this point in the history
  • Loading branch information
liuminghui233 authored Feb 29, 2024
1 parent 250e936 commit e11bdf0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ public boolean canSkip(IMetadata metadata) {

@Override
public boolean allSatisfy(IMetadata metadata) {
if (metadata.hasNullValue(measurementIndex)) {
// null not satisfy any filter, except IS NULL
return false;
}
Optional<Statistics<? extends Serializable>> statistics =
metadata.getMeasurementStatistics(measurementIndex);
return statistics.map(this::allSatisfy).orElse(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ public static ValueRegexp like(int measurementIndex, String likePattern) {
return regexp(measurementIndex, RegexUtils.parseLikePatternToRegex(likePattern));
}

public static ValueRegexp like(int measurementIndex, Pattern pattern) {
return regexp(measurementIndex, pattern);
}

public static ValueNotRegexp notLike(String likePattern) {
return notRegexp(DEFAULT_MEASUREMENT_INDEX, RegexUtils.parseLikePatternToRegex(likePattern));
}
Expand All @@ -144,6 +148,10 @@ public static ValueNotRegexp notLike(int measurementIndex, String likePattern) {
return notRegexp(measurementIndex, RegexUtils.parseLikePatternToRegex(likePattern));
}

public static ValueNotRegexp notLike(int measurementIndex, Pattern pattern) {
return notRegexp(measurementIndex, pattern);
}

public static ValueRegexp regexp(String regex) {
return new ValueRegexp(DEFAULT_MEASUREMENT_INDEX, RegexUtils.compileRegex(regex));
}
Expand Down

0 comments on commit e11bdf0

Please sign in to comment.