diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/PostAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/PostAggregator.java index 06e64af1287..399947afb34 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/PostAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/PostAggregator.java @@ -23,6 +23,8 @@ import org.apache.druid.guice.annotations.ExtensionPoint; import org.apache.druid.java.util.common.Cacheable; import org.apache.druid.segment.ColumnInspector; import org.apache.druid.segment.column.ColumnType; +import org.apache.druid.segment.column.ColumnTypeFactory; +import org.apache.druid.segment.column.ValueType; import javax.annotation.Nullable; import java.util.Comparator; @@ -48,10 +50,27 @@ public interface PostAggregator extends Cacheable /** * Return the output type of a row processed with this post aggregator. Refer to the {@link ColumnType} javadocs * for details on the implications of choosing a type. + * * @param signature */ @Nullable - ColumnType getType(ColumnInspector signature); + default ColumnType getType(ColumnInspector signature) + { + return ColumnTypeFactory.ofValueType(getType()); + } + + /** + * This method is deprecated and will be removed soon. Use {@link #getType(ColumnInspector)} instead. Do not call this + * method, it will likely produce incorrect results, it exists for backwards compatibility. + */ + @Deprecated + default ValueType getType() + { + throw new UnsupportedOperationException( + "Do not call or implement this method, it is deprecated, use 'getType(ColumnInspector)' instead" + ); + } + /** * Allows returning an enriched post aggregator, built from contextual information available from the given map of