Sh-Zh-7 commented on code in PR #172:
URL: https://github.com/apache/tsfile/pull/172#discussion_r1673470769
##########
java/tsfile/src/main/java/org/apache/tsfile/read/filter/operator/ValueFilterOperators.java:
##########
@@ -765,7 +771,89 @@ public ValueIn(ByteBuffer buffer) {
@Override
public boolean valueSatisfy(Object value) {
- return candidates.contains(value);
+ return candidates.contains((T) value);
+ }
+
+ @Override
+ public boolean canSkip(IMetadata metadata) {
+ Optional<Statistics<? extends Serializable>> statistics =
+ metadata.getMeasurementStatistics(measurementIndex);
+
+ // All values are null, but candidates do not contain null
+ if ((!statistics.isPresent() || isAllNulls(statistics.get())) &&
!candidates.contains(null)) {
+ return true;
+ }
+
+ // All values are not null, but candidate is one null value
+ if (metadata.hasNullValue(measurementIndex)
+ && candidates.size() == 1
+ && candidates.contains(null)) {
+ return true;
+ }
+
+ if (statistics.isPresent()) {
+ T valuesMin = (T) statistics.get().getMinValue();
+ T valuesMax = (T) statistics.get().getMaxValue();
+ // All values are same
+ if (valuesMin == valuesMax) {
+ for (T val : candidates) {
+ if (valuesMin == val) {
Review Comment:
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]