diff --git a/processing/src/main/java/org/apache/druid/query/filter/vector/FalseVectorMatcher.java b/processing/src/main/java/org/apache/druid/query/filter/vector/FalseVectorMatcher.java deleted file mode 100644 index 9d20c1dd25e..00000000000 --- a/processing/src/main/java/org/apache/druid/query/filter/vector/FalseVectorMatcher.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.query.filter.vector; - -import org.apache.druid.segment.vector.VectorSizeInspector; - -public class FalseVectorMatcher implements VectorValueMatcher -{ - private final VectorSizeInspector vectorSizeInspector; - - public FalseVectorMatcher(VectorSizeInspector vectorSizeInspector) - { - this.vectorSizeInspector = vectorSizeInspector; - } - - @Override - public ReadableVectorMatch match(ReadableVectorMatch mask) - { - return VectorMatch.allFalse(); - } - - @Override - public int getMaxVectorSize() - { - return vectorSizeInspector.getMaxVectorSize(); - } - - @Override - public int getCurrentVectorSize() - { - return vectorSizeInspector.getCurrentVectorSize(); - } -} diff --git a/processing/src/main/java/org/apache/druid/query/filter/vector/TrueVectorMatcher.java b/processing/src/main/java/org/apache/druid/query/filter/vector/TrueVectorMatcher.java deleted file mode 100644 index 24b2b273a46..00000000000 --- a/processing/src/main/java/org/apache/druid/query/filter/vector/TrueVectorMatcher.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.query.filter.vector; - -import org.apache.druid.segment.vector.VectorSizeInspector; - -public class TrueVectorMatcher implements VectorValueMatcher -{ - private final VectorSizeInspector vectorSizeInspector; - - public TrueVectorMatcher(VectorSizeInspector vectorSizeInspector) - { - this.vectorSizeInspector = vectorSizeInspector; - } - - @Override - public ReadableVectorMatch match(ReadableVectorMatch mask) - { - // The given mask is all true for its valid selections. - return mask; - } - - @Override - public int getMaxVectorSize() - { - return vectorSizeInspector.getMaxVectorSize(); - } - - @Override - public int getCurrentVectorSize() - { - return vectorSizeInspector.getCurrentVectorSize(); - } -} diff --git a/processing/src/main/java/org/apache/druid/segment/filter/FalseFilter.java b/processing/src/main/java/org/apache/druid/segment/filter/FalseFilter.java index f5b0397e49b..27223d92fbc 100644 --- a/processing/src/main/java/org/apache/druid/segment/filter/FalseFilter.java +++ b/processing/src/main/java/org/apache/druid/segment/filter/FalseFilter.java @@ -23,7 +23,7 @@ import org.apache.druid.query.BitmapResultFactory; import org.apache.druid.query.filter.BitmapIndexSelector; import org.apache.druid.query.filter.Filter; import org.apache.druid.query.filter.ValueMatcher; -import org.apache.druid.query.filter.vector.FalseVectorMatcher; +import org.apache.druid.query.filter.vector.BooleanVectorValueMatcher; import org.apache.druid.query.filter.vector.VectorValueMatcher; import org.apache.druid.segment.ColumnSelector; import org.apache.druid.segment.ColumnSelectorFactory; @@ -67,7 +67,7 @@ public class FalseFilter implements Filter @Override public VectorValueMatcher makeVectorMatcher(VectorColumnSelectorFactory factory) { - return new FalseVectorMatcher(factory.getReadableVectorInspector()); + return BooleanVectorValueMatcher.of(factory.getReadableVectorInspector(), false); } @Override diff --git a/processing/src/main/java/org/apache/druid/segment/filter/TrueFilter.java b/processing/src/main/java/org/apache/druid/segment/filter/TrueFilter.java index f6fb4ee87a8..40f4923b351 100644 --- a/processing/src/main/java/org/apache/druid/segment/filter/TrueFilter.java +++ b/processing/src/main/java/org/apache/druid/segment/filter/TrueFilter.java @@ -23,7 +23,7 @@ import org.apache.druid.query.BitmapResultFactory; import org.apache.druid.query.filter.BitmapIndexSelector; import org.apache.druid.query.filter.Filter; import org.apache.druid.query.filter.ValueMatcher; -import org.apache.druid.query.filter.vector.TrueVectorMatcher; +import org.apache.druid.query.filter.vector.BooleanVectorValueMatcher; import org.apache.druid.query.filter.vector.VectorValueMatcher; import org.apache.druid.segment.ColumnSelector; import org.apache.druid.segment.ColumnSelectorFactory; @@ -34,6 +34,7 @@ import java.util.Map; import java.util.Set; /** + * */ public class TrueFilter implements Filter { @@ -57,13 +58,13 @@ public class TrueFilter implements Filter @Override public ValueMatcher makeMatcher(ColumnSelectorFactory factory) { - return TrueValueMatcher.instance(); + return BooleanValueMatcher.of(true); } @Override public VectorValueMatcher makeVectorMatcher(VectorColumnSelectorFactory factory) { - return new TrueVectorMatcher(factory.getReadableVectorInspector()); + return BooleanVectorValueMatcher.of(factory.getReadableVectorInspector(), true); } @Override