mirror of https://github.com/apache/druid.git
Fix comparator and remove deprecated methods from spectatorHistogram extension (#15698)
* Remove deprecated methods from SpectatorHistogram * Remove deprecated methods from SpectatorHistogram * Remove deprecated methods from SpectatorHistogram
This commit is contained in:
parent
a26defd64b
commit
a3b32fbd26
|
@ -32,7 +32,7 @@ import org.apache.druid.query.aggregation.ObjectAggregateCombiner;
|
|||
import org.apache.druid.query.cache.CacheKeyBuilder;
|
||||
import org.apache.druid.segment.ColumnSelectorFactory;
|
||||
import org.apache.druid.segment.ColumnValueSelector;
|
||||
import org.apache.druid.segment.column.ValueType;
|
||||
import org.apache.druid.segment.column.ColumnType;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
@ -54,6 +54,7 @@ public class SpectatorHistogramAggregatorFactory extends AggregatorFactory
|
|||
private final byte cacheTypeId;
|
||||
|
||||
public static final String TYPE_NAME = "spectatorHistogram";
|
||||
public static final ColumnType TYPE = ColumnType.ofComplex(TYPE_NAME);
|
||||
|
||||
@JsonCreator
|
||||
public SpectatorHistogramAggregatorFactory(
|
||||
|
@ -147,17 +148,6 @@ public class SpectatorHistogramAggregatorFactory extends AggregatorFactory
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AggregatorFactory> getRequiredColumns()
|
||||
{
|
||||
return Collections.singletonList(
|
||||
new SpectatorHistogramAggregatorFactory(
|
||||
fieldName,
|
||||
fieldName
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object deserialize(Object serializedHistogram)
|
||||
{
|
||||
|
@ -191,21 +181,15 @@ public class SpectatorHistogramAggregatorFactory extends AggregatorFactory
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getComplexTypeName()
|
||||
public ColumnType getIntermediateType()
|
||||
{
|
||||
return TYPE_NAME;
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueType getType()
|
||||
public ColumnType getResultType()
|
||||
{
|
||||
return ValueType.COMPLEX;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueType getFinalizedType()
|
||||
{
|
||||
return ValueType.COMPLEX;
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -290,6 +274,7 @@ public class SpectatorHistogramAggregatorFactory extends AggregatorFactory
|
|||
public static class Timer extends SpectatorHistogramAggregatorFactory
|
||||
{
|
||||
public static final String TYPE_NAME = "spectatorHistogramTimer";
|
||||
public static final ColumnType TYPE = ColumnType.ofComplex(TYPE_NAME);
|
||||
|
||||
public Timer(
|
||||
@JsonProperty("name") final String name,
|
||||
|
@ -305,9 +290,15 @@ public class SpectatorHistogramAggregatorFactory extends AggregatorFactory
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getComplexTypeName()
|
||||
public ColumnType getIntermediateType()
|
||||
{
|
||||
return TYPE_NAME;
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ColumnType getResultType()
|
||||
{
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -315,23 +306,13 @@ public class SpectatorHistogramAggregatorFactory extends AggregatorFactory
|
|||
{
|
||||
return new SpectatorHistogramAggregatorFactory.Timer(getName(), getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AggregatorFactory> getRequiredColumns()
|
||||
{
|
||||
return Collections.singletonList(
|
||||
new SpectatorHistogramAggregatorFactory.Timer(
|
||||
getFieldName(),
|
||||
getFieldName()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@JsonTypeName(SpectatorHistogramAggregatorFactory.Distribution.TYPE_NAME)
|
||||
public static class Distribution extends SpectatorHistogramAggregatorFactory
|
||||
{
|
||||
public static final String TYPE_NAME = "spectatorHistogramDistribution";
|
||||
public static final ColumnType TYPE = ColumnType.ofComplex(TYPE_NAME);
|
||||
|
||||
public Distribution(
|
||||
@JsonProperty("name") final String name,
|
||||
|
@ -347,9 +328,15 @@ public class SpectatorHistogramAggregatorFactory extends AggregatorFactory
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getComplexTypeName()
|
||||
public ColumnType getIntermediateType()
|
||||
{
|
||||
return TYPE_NAME;
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ColumnType getResultType()
|
||||
{
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -357,16 +344,5 @@ public class SpectatorHistogramAggregatorFactory extends AggregatorFactory
|
|||
{
|
||||
return new SpectatorHistogramAggregatorFactory.Distribution(getName(), getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AggregatorFactory> getRequiredColumns()
|
||||
{
|
||||
return Collections.singletonList(
|
||||
new SpectatorHistogramAggregatorFactory.Distribution(
|
||||
getFieldName(),
|
||||
getFieldName()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ package org.apache.druid.spectator.histogram;
|
|||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.primitives.Doubles;
|
||||
import org.apache.druid.query.aggregation.AggregatorFactory;
|
||||
import org.apache.druid.query.aggregation.PostAggregator;
|
||||
import org.apache.druid.query.aggregation.post.PostAggregatorIds;
|
||||
|
@ -91,9 +90,9 @@ public class SpectatorHistogramPercentilesPostAggregator implements PostAggregat
|
|||
}
|
||||
|
||||
@Override
|
||||
public Comparator<Double> getComparator()
|
||||
public Comparator<Object> getComparator()
|
||||
{
|
||||
return Doubles::compare;
|
||||
return ColumnType.DOUBLE_ARRAY.getStrategy();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -72,13 +72,6 @@ public class PassthroughAggregatorFactory extends AggregatorFactory
|
|||
return columnName;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonProperty
|
||||
public String getComplexTypeName()
|
||||
{
|
||||
return complexTypeName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getCacheKey()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue