Skip to content

Commit

Permalink
Update tdigest to 3.3
Browse files Browse the repository at this point in the history
Release notes: tdunning/t-digest#194
  • Loading branch information
mfussenegger authored and mergify[bot] committed Jan 8, 2024
1 parent 1a7cf8c commit 93020ad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion docs/appendices/release-notes/5.6.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@ Data Types
Scalar and Aggregation Functions
--------------------------------

None
- Updated the ``tdigest`` library which results in the ``percentile``
aggregation function to behave differently in some cases. For example, the
following query used to return ``4.5`` but will now return ``5.0``::

SELECT percentile(x, 0.5) FROM generate_series(0, 9, 1) AS t (x) ;


Performance and Resilience Improvements
---------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
<versions.spatial4j>0.8</versions.spatial4j>
<versions.jts>1.19.0</versions.jts>
<versions.jna>5.13.0</versions.jna>
<versions.tdigest>3.2</versions.tdigest>
<versions.tdigest>3.3</versions.tdigest>
<versions.hdrhistogram>2.1.12</versions.hdrhistogram>
<versions.caffeine>3.1.8</versions.caffeine>
<versions.jodatime>2.12.5</versions.jodatime>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ public void testReturnTypes() throws Exception {
}

@Test
public void testSignleFractionAllTypesReturnSameResult() throws Exception {
public void testSingleFractionAllTypesReturnSameResult() throws Exception {
for (DataType<?> valueType : DataTypes.NUMERIC_PRIMITIVE_TYPES) {
List<Double> fractions = Arrays.asList(0.5, 0.8);
Object[][] rowsWithSingleFraction = new Object[10][];
for (int i = 0; i < rowsWithSingleFraction.length; i++) {
rowsWithSingleFraction[i] = new Object[]{ valueType.sanitizeValue(i), fractions.get(0) };
}
assertThat(execSingleFractionPercentile(valueType, rowsWithSingleFraction)).isEqualTo(4.5);
assertThat(execSingleFractionPercentile(valueType, rowsWithSingleFraction)).isEqualTo(5.0);
}
}

Expand All @@ -123,7 +123,7 @@ public void testWithFractionsAllTypesReturnSameResult() throws Exception {
rowsWithFractionsArray[i] = new Object[]{ valueType.sanitizeValue(i), fractions };
}
assertThat(execArrayFractionPercentile(valueType, rowsWithFractionsArray))
.isEqualTo(List.of(4.5, 7.5));
.isEqualTo(List.of(5.0, 8.0));
}
}

Expand Down

0 comments on commit 93020ad

Please sign in to comment.