use of org.apache.druid.collections.SerializablePair in project druid by druid-io.
the class DoubleFirstAggregationTest method testCombine.
@Test
public void testCombine() {
SerializablePair pair1 = new SerializablePair<>(1467225000L, 3.621);
SerializablePair pair2 = new SerializablePair<>(1467240000L, 785.4);
Assert.assertEquals(pair1, doubleFirstAggFactory.combine(pair1, pair2));
}
use of org.apache.druid.collections.SerializablePair in project druid by druid-io.
the class DoubleLastAggregationTest method testComparatorWithNulls.
@Test
public void testComparatorWithNulls() {
SerializablePair pair1 = new SerializablePair<>(1467225000L, 3.621);
SerializablePair pair2 = new SerializablePair<>(1467240000L, null);
Comparator comparator = doubleLastAggFactory.getComparator();
Assert.assertEquals(1, comparator.compare(pair1, pair2));
Assert.assertEquals(0, comparator.compare(pair1, pair1));
Assert.assertEquals(0, comparator.compare(pair2, pair2));
Assert.assertEquals(-1, comparator.compare(pair2, pair1));
}
use of org.apache.druid.collections.SerializablePair in project druid by druid-io.
the class DoubleLastAggregationTest method testCombine.
@Test
public void testCombine() {
SerializablePair pair1 = new SerializablePair<>(1467225000L, 3.621);
SerializablePair pair2 = new SerializablePair<>(1467240000L, 785.4);
Assert.assertEquals(pair2, doubleLastAggFactory.combine(pair1, pair2));
}
use of org.apache.druid.collections.SerializablePair in project druid by druid-io.
the class LongLastAggregationTest method testComparatorWithNulls.
@Test
public void testComparatorWithNulls() {
SerializablePair pair1 = new SerializablePair<>(1467225000L, 1263L);
SerializablePair pair2 = new SerializablePair<>(1467240000L, null);
Comparator comparator = longLastAggFactory.getComparator();
Assert.assertEquals(1, comparator.compare(pair1, pair2));
Assert.assertEquals(0, comparator.compare(pair1, pair1));
Assert.assertEquals(0, comparator.compare(pair2, pair2));
Assert.assertEquals(-1, comparator.compare(pair2, pair1));
}
use of org.apache.druid.collections.SerializablePair in project druid by druid-io.
the class FloatLastAggregationTest method testCombine.
@Test
public void testCombine() {
SerializablePair pair1 = new SerializablePair<>(1467225000L, 3.621f);
SerializablePair pair2 = new SerializablePair<>(1467240000L, 785.4f);
Assert.assertEquals(pair2, floatLastAggregatorFactory.combine(pair1, pair2));
}
Aggregations