Package org.apache.druid.query.topn
Class DimValHolder.Builder
java.lang.Object
org.apache.druid.query.topn.DimValHolder.Builder
- Enclosing class:
- DimValHolder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()withDimValIndex(Object dimValIndex) withDimValue(Object dimValue, ColumnType type) This method is called byTopNResultBuilder.addEntry(java.lang.Object, java.lang.Object, java.lang.Object[])to store query results.withMetricValues(Map<String, Object> metricValues) withTopNMetricVal(Object topNMetricVal)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
withTopNMetricVal
-
withDimValue
This method is called byTopNResultBuilder.addEntry(java.lang.Object, java.lang.Object, java.lang.Object[])to store query results. The method accepts a type argument because Jackson will deserialize numbers as integers instead of longs if they are small enough. Similarly, type mismatch can arise when using floats when Jackson deserializes numbers as doubles instead. This method will ensure that any added dimension value is converted to the expected type.- Parameters:
dimValue- Dimension value from TopNResultBuildertype- Type that dimValue should have, according to the output type of theDimensionSpecassociated with dimValue from the calling TopNResultBuilder
-
withDimValIndex
-
withMetricValues
-
build
-