Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static ColumnType ofArray(ColumnType elementType)
{
return ColumnTypeFactory.getInstance().ofArray(elementType);
}
public static ColumnType ofComplex(String complexTypeName)
public static ColumnType ofComplex(@Nullable String complexTypeName)
{
return ColumnTypeFactory.getInstance().ofComplex(complexTypeName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@ public byte[] getCacheKey()
* and {@link DistinctCountAggregator#get} returns an integer for the number of set bits in the bitmap.
*/
@Override
public ColumnType getType()
public ColumnType getIntermediateType()
{
return ColumnType.LONG;
}

@Override
public ColumnType getFinalizedType()
public ColumnType getResultType()
{
return ColumnType.LONG;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ public List<String> requiredFields()
* actual type is {@link MomentSketchWrapper}
*/
@Override
public ColumnType getType()
public ColumnType getIntermediateType()
{
return TYPE;
}

@Override
public ColumnType getFinalizedType()
public ColumnType getResultType()
{
return TYPE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@ public byte[] getCacheKey()
}

@Override
public ColumnType getType()
public ColumnType getIntermediateType()
{
return ColumnType.UNKNOWN_COMPLEX;
}

@Override
public ColumnType getFinalizedType()
public ColumnType getResultType()
{
return getType();
return getIntermediateType();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ public List<String> requiredFields()
* actual type is {@link MergingDigest}
*/
@Override
public ColumnType getType()
public ColumnType getIntermediateType()
{
return TYPE;
}

@Override
public ColumnType getFinalizedType()
public ColumnType getResultType()
{
return TYPE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public byte[] getCacheKey()
}

@Override
public ColumnType getType()
public ColumnType getIntermediateType()
{
return ColumnType.LONG;
}
Expand All @@ -209,7 +209,7 @@ public ColumnType getType()
* actual type is {@link DateTime}
*/
@Override
public ColumnType getFinalizedType()
public ColumnType getResultType()
{
return FINALIZED_TYPE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public Class<HllSketch> classOfObject()
}

@Override
public ColumnType getFinalizedType()
public ColumnType getResultType()
{
return round ? ColumnType.LONG : ColumnType.DOUBLE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public HllSketchBuildAggregatorFactory(
}

@Override
public ColumnType getType()
public ColumnType getIntermediateType()
{
return TYPE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public AggregatorFactory getMergingFactory(AggregatorFactory other) throws Aggre
}

@Override
public ColumnType getType()
public ColumnType getIntermediateType()
{
return TYPE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,13 @@ public Object finalizeComputation(@Nullable final Object object)
* actual type is {@link DoublesSketch}
*/
@Override
public ColumnType getType()
public ColumnType getIntermediateType()
{
return DoublesSketchModule.TYPE;
}

@Override
public ColumnType getFinalizedType()
public ColumnType getResultType()
{
return ColumnType.LONG;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public Object finalizeComputation(@Nullable Object object)
* actual type is {@link SketchHolder}
*/
@Override
public ColumnType getType()
public ColumnType getIntermediateType()
{
return isInputThetaSketch ? SketchModule.MERGE_TYPE : SketchModule.BUILD_TYPE;
}
Expand All @@ -156,12 +156,12 @@ public ColumnType getType()
* if {@link #shouldFinalize} is NOT set, type is {@link SketchHolder}
*/
@Override
public ColumnType getFinalizedType()
public ColumnType getResultType()
{
if (shouldFinalize && errorBoundsStdDev == null) {
return ColumnType.DOUBLE;
}
return getType();
return getIntermediateType();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,13 @@ public Object finalizeComputation(@Nullable final Object object)
* actual type is {@link ArrayOfDoublesSketch}
*/
@Override
public ColumnType getType()
public ColumnType getIntermediateType()
{
return metricColumns == null ? ArrayOfDoublesSketchModule.MERGE_TYPE : ArrayOfDoublesSketchModule.BUILD_TYPE;
}

@Override
public ColumnType getFinalizedType()
public ColumnType getResultType()
{
return ColumnType.DOUBLE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public BufferAggregator factorizeBuffered(ColumnSelectorFactory metricFactory)
}

@Override
public ColumnType getType()
public ColumnType getIntermediateType()
{
return new ColumnType(ValueType.COMPLEX, DUMMY_TYPE_NAME, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ public List<String> requiredFields()
* actual type is {@link ByteBuffer} containing {@link BloomKFilter}
*/
@Override
public ColumnType getType()
public ColumnType getIntermediateType()
{
return TYPE;
}

@Override
public ColumnType getFinalizedType()
public ColumnType getResultType()
{
return TYPE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public byte[] getCacheKey()
* actual type is {@link ApproximateHistogram}
*/
@Override
public ColumnType getType()
public ColumnType getIntermediateType()
{
return TYPE;
}
Expand All @@ -336,7 +336,7 @@ public ColumnType getType()
* actual type is {@link ApproximateHistogram} if {@link #finalizeAsBase64Binary} is set, else {@link Histogram}
*/
@Override
public ColumnType getFinalizedType()
public ColumnType getResultType()
{
return finalizeAsBase64Binary ? TYPE : HistogramAggregatorFactory.TYPE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public List<String> requiredFields()
* actual type is {@link FixedBucketsHistogram}
*/
@Override
public ColumnType getType()
public ColumnType getIntermediateType()
{
return FixedBucketsHistogramAggregator.TYPE;
}
Expand All @@ -291,7 +291,7 @@ public ColumnType getType()
* actual type is {@link FixedBucketsHistogram} if {@link #finalizeAsBase64Binary} is set
*/
@Override
public ColumnType getFinalizedType()
public ColumnType getResultType()
{
return finalizeAsBase64Binary ? FixedBucketsHistogramAggregator.TYPE : ColumnType.STRING;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ public VarianceAggregatorFactory(
* actual type is {@link VarianceAggregatorCollector}
*/
@Override
public ColumnType getType()
public ColumnType getIntermediateType()
{
return TYPE;
}

@Override
public ColumnType getFinalizedType()
public ColumnType getResultType()
{
return ColumnType.DOUBLE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public static SerializeResult toBytes(
parseExceptionMessages.add(e.getMessage());
}

final ColumnType type = aggFactory.getType();
final ColumnType type = aggFactory.getIntermediateType();

if (agg.isNull()) {
out.writeByte(NullHandling.IS_NULL_BYTE);
Expand Down Expand Up @@ -473,7 +473,7 @@ public static InputRow fromBytes(
for (int i = 0; i < metricSize; i++) {
final String metric = readString(in);
final AggregatorFactory agg = getAggregator(metric, aggs, i);
final ColumnType type = agg.getType();
final ColumnType type = agg.getIntermediateType();
final byte metricNullability = in.readByte();

if (metricNullability == NullHandling.IS_NULL_BYTE) {
Expand All @@ -487,7 +487,7 @@ public static InputRow fromBytes(
} else if (type.is(ValueType.DOUBLE)) {
event.put(metric, in.readDouble());
} else {
ComplexMetricSerde serde = getComplexMetricSerde(agg.getType().getComplexTypeName());
ComplexMetricSerde serde = getComplexMetricSerde(agg.getIntermediateType().getComplexTypeName());
byte[] value = readBytes(in);
event.put(metric, serde.fromBytes(value, 0, value.length));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ public void testSerde()

final AggregatorFactory mockedAggregatorFactory = EasyMock.createMock(AggregatorFactory.class);
EasyMock.expect(mockedAggregatorFactory.factorize(EasyMock.anyObject(ColumnSelectorFactory.class))).andReturn(mockedAggregator);
EasyMock.expect(mockedAggregatorFactory.getType()).andReturn(ColumnType.DOUBLE).anyTimes();
EasyMock.expect(mockedAggregatorFactory.getIntermediateType()).andReturn(ColumnType.DOUBLE).anyTimes();
EasyMock.expect(mockedAggregatorFactory.getName()).andReturn("mockedAggregator").anyTimes();

final AggregatorFactory mockedNullAggregatorFactory = EasyMock.createMock(AggregatorFactory.class);
EasyMock.expect(mockedNullAggregatorFactory.factorize(EasyMock.anyObject(ColumnSelectorFactory.class))).andReturn(mockedNullAggregator);
EasyMock.expect(mockedNullAggregatorFactory.getName()).andReturn("mockedNullAggregator").anyTimes();
EasyMock.expect(mockedNullAggregatorFactory.getType()).andReturn(ColumnType.DOUBLE).anyTimes();
EasyMock.expect(mockedNullAggregatorFactory.getIntermediateType()).andReturn(ColumnType.DOUBLE).anyTimes();

EasyMock.replay(mockedAggregatorFactory, mockedNullAggregatorFactory);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1984,7 +1984,7 @@ private static ColumnHolder createColumn(DimensionSchema dimensionSchema)

private static ColumnHolder createColumn(AggregatorFactory aggregatorFactory)
{
return new TestColumn(aggregatorFactory.getType());
return new TestColumn(aggregatorFactory.getIntermediateType());
}

private static class TestColumn implements ColumnHolder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static int findNumComplexAggs(List<AggregatorFactory> aggs)
{
int retVal = 0;
for (AggregatorFactory agg : aggs) {
if (agg.getType().is(ValueType.COMPLEX)) {
if (agg.getIntermediateType().is(ValueType.COMPLEX)) {
retVal++;
}
}
Expand Down
Loading