You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2023/04/04 07:20:20 UTC
[iotdb] branch rel/1.1 updated: [To rel/1.1] [ISSUE-9508] Fix the bug of UDF Median and Percentile
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch rel/1.1
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rel/1.1 by this push:
new 32b8276a43 [To rel/1.1] [ISSUE-9508] Fix the bug of UDF Median and Percentile
32b8276a43 is described below
commit 32b8276a43b36de0756963f5a67f8a15417607d5
Author: Haoyu Wang <37...@users.noreply.github.com>
AuthorDate: Tue Apr 4 15:20:11 2023 +0800
[To rel/1.1] [ISSUE-9508] Fix the bug of UDF Median and Percentile
---
.../org/apache/iotdb/library/dprofile/util/GKArray.java | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/library-udf/src/main/java/org/apache/iotdb/library/dprofile/util/GKArray.java b/library-udf/src/main/java/org/apache/iotdb/library/dprofile/util/GKArray.java
index 8185288375..5cfcf2ad35 100644
--- a/library-udf/src/main/java/org/apache/iotdb/library/dprofile/util/GKArray.java
+++ b/library-udf/src/main/java/org/apache/iotdb/library/dprofile/util/GKArray.java
@@ -18,17 +18,16 @@
*/
package org.apache.iotdb.library.dprofile.util;
-import org.eclipse.collections.api.factory.Lists;
-import org.eclipse.collections.api.list.MutableList;
-
import java.io.Serializable;
+import java.util.ArrayList;
import java.util.Comparator;
+import java.util.List;
/** Util for UDAFPercentile */
public class GKArray {
private final double rankAccuracy;
- private MutableList<Tuple> entries;
+ private ArrayList<Tuple> entries;
private final double[] incoming;
private int incomingIndex;
private long compressedCount;
@@ -36,7 +35,7 @@ public class GKArray {
public GKArray(double rankAccuracy) {
this.rankAccuracy = rankAccuracy;
- this.entries = Lists.mutable.empty();
+ this.entries = new ArrayList<>();
this.incoming = new double[(int) (1 / rankAccuracy) + 1];
this.incomingIndex = 0;
this.minValue = Double.MAX_VALUE;
@@ -87,10 +86,10 @@ public class GKArray {
}
private void compress() {
- compress(Lists.mutable.empty());
+ compress(new ArrayList<>());
}
- private void compress(MutableList<Tuple> additionalEntries) {
+ private void compress(List<Tuple> additionalEntries) {
for (int i = 0; i < incomingIndex; i++) {
additionalEntries.add(new Tuple(incoming[i], 1, 0));
@@ -103,8 +102,8 @@ public class GKArray {
}
final long removalThreshold = 2 * (long) (rankAccuracy * (compressedCount - 1));
- final MutableList<Tuple> mergedEntries =
- Lists.mutable.ofInitialCapacity(entries.size() + additionalEntries.size() / 3);
+ final ArrayList<Tuple> mergedEntries =
+ new ArrayList<>(entries.size() + additionalEntries.size() / 3);
int i = 0, j = 0;
while (i < additionalEntries.size() || j < entries.size()) {