Fix merge for TrueDimFilter (#5916)

* Fix merge for TrueDimFilter

* remove unused cache ID
This commit is contained in:
Jonathan Wei 2018-06-28 14:46:47 -07:00 committed by GitHub
parent bf2a31a5bc
commit f3e1520360
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 63 deletions

View File

@ -53,7 +53,7 @@ import io.druid.java.util.common.DateTimes;
import io.druid.java.util.common.Intervals;
import io.druid.java.util.common.JodaUtils;
import io.druid.query.aggregation.LongSumAggregatorFactory;
import io.druid.query.filter.NoopDimFilter;
import io.druid.query.filter.TrueDimFilter;
import io.druid.segment.IndexIO;
import io.druid.segment.IndexMergerV9;
import io.druid.segment.IndexSpec;
@ -350,7 +350,7 @@ public class IngestSegmentFirehoseFactoryTimelineTest
final IngestSegmentFirehoseFactory factory = new IngestSegmentFirehoseFactory(
DATA_SOURCE,
testCase.interval,
new NoopDimFilter(),
new TrueDimFilter(),
Arrays.asList(DIMENSIONS),
Arrays.asList(METRICS),
INDEX_IO

View File

@ -36,7 +36,6 @@ import java.util.Set;
*/
public class DimFilterUtils
{
static final byte NOOP_CACHE_ID = -0x4;
static final byte SELECTOR_CACHE_ID = 0x0;
static final byte AND_CACHE_ID = 0x1;
static final byte OR_CACHE_ID = 0x2;

View File

@ -1,60 +0,0 @@
/*
* Licensed to Metamarkets Group Inc. (Metamarkets) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Metamarkets 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 io.druid.query.filter;
import com.google.common.collect.RangeSet;
import java.nio.ByteBuffer;
import java.util.HashSet;
/**
*/
public class NoopDimFilter implements DimFilter
{
@Override
public byte[] getCacheKey()
{
return ByteBuffer.allocate(1).put(DimFilterUtils.NOOP_CACHE_ID).array();
}
@Override
public DimFilter optimize()
{
return this;
}
@Override
public Filter toFilter()
{
return null;
}
@Override
public RangeSet<String> getDimensionRangeSet(String dimension)
{
return null;
}
@Override
public HashSet<String> getRequiredColumns()
{
return null;
}
}

View File

@ -23,11 +23,14 @@ import com.google.common.collect.RangeSet;
import io.druid.segment.filter.TrueFilter;
import java.nio.ByteBuffer;
import java.util.HashSet;
/**
*/
public class TrueDimFilter implements DimFilter
{
private static HashSet<String> REQUIRED_COLUMNS = new HashSet<>();
@Override
public byte[] getCacheKey()
{
@ -51,4 +54,10 @@ public class TrueDimFilter implements DimFilter
{
return null;
}
@Override
public HashSet<String> getRequiredColumns()
{
return REQUIRED_COLUMNS;
}
}