You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2021/01/06 22:05:54 UTC

[datasketches-java] branch master updated: Add HRA check to merge

This is an automated email from the ASF dual-hosted git repository.

leerho pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/datasketches-java.git


The following commit(s) were added to refs/heads/master by this push:
     new 3501b0d  Add HRA check to merge
3501b0d is described below

commit 3501b0df9f1971e3d91d9e702d427e8a76557bee
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Wed Jan 6 14:05:39 2021 -0800

    Add HRA check to merge
---
 src/main/java/org/apache/datasketches/req/ReqSketch.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/main/java/org/apache/datasketches/req/ReqSketch.java b/src/main/java/org/apache/datasketches/req/ReqSketch.java
index 51f3e72..aca257a 100644
--- a/src/main/java/org/apache/datasketches/req/ReqSketch.java
+++ b/src/main/java/org/apache/datasketches/req/ReqSketch.java
@@ -432,6 +432,10 @@ public class ReqSketch extends BaseReqSketch {
   @Override
   public ReqSketch merge(final ReqSketch other) {
     if (other == null || other.isEmpty()) { return this; }
+    if (other.hra != hra) {
+      throw new SketchesArgumentException(
+          "Both sketches must have the same HighRankAccuracy setting.");
+    }
     totalN += other.totalN;
     //update min, max values, n
     if (Float.isNaN(minValue) || other.minValue < minValue) { minValue = other.minValue; }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org