use the latest datasketches-java-3.0.0
diff --git a/NOTICE b/NOTICE index edc7a6b..e3aeae7 100644 --- a/NOTICE +++ b/NOTICE
@@ -1,5 +1,5 @@ Apache DataSketches Pig -Copyright 2020 - The Apache Software Foundation +Copyright 2022 - The Apache Software Foundation Copyright 2015-2018 Yahoo Copyright 2019 Verizon Media
diff --git a/pom.xml b/pom.xml index ab68c9f..1b71b3e 100644 --- a/pom.xml +++ b/pom.xml
@@ -51,11 +51,11 @@ <archive>https://mail-archives.apache.org/mod_mbox/datasketches-dev</archive> </mailingList> <mailingList> - <name>sketches-user</name> - <archive>https://groups.google.com/forum/#!forum/sketches-user</archive> - <subscribe>mailto:sketches-user%2Bsubscribe@googlegroups.com</subscribe> - <unsubscribe>mailto:sketches-user%2Bunsubscribe@googlegroups.com</unsubscribe> - <post>mailto:sketches-user@googlegroups.com</post> + <name>DataSketches Users</name> + <subscribe>user-subscribe@datasketches.apache.org</subscribe> + <unsubscribe>user-unsubscribe@datasketches.apache.org</unsubscribe> + <post>user@datasketches.apache.org</post> + <archive>https://mail-archives.apache.org/mod_mbox/datasketches-user</archive> </mailingList> </mailingLists> @@ -85,17 +85,17 @@ <properties> <!-- UNIQUE FOR THIS JAVA COMPONENT --> - <datasketches-java.version>1.3.0-incubating</datasketches-java.version> + <datasketches-java.version>3.0.0</datasketches-java.version> <pig.version>0.17.0</pig.version> <hadoop-common.version>2.8.5</hadoop-common.version> <commons-math3.version>3.6.1</commons-math3.version> <!-- END:UNIQUE FOR THIS JAVA COMPONENT --> <!-- Test --> - <testng.version>7.1.0</testng.version> + <testng.version>7.4.0</testng.version> <!-- System-wide properties --> - <maven.version>3.0.0</maven.version> + <maven.version>3.5.0</maven.version> <java.version>1.8</java.version> <maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.target>${java.version}</maven.compiler.target> @@ -112,22 +112,22 @@ <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version> <!-- overrides parent --> <maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version> <!-- overrides parent --> <maven-enforcer-plugin.version>3.0.0-M2</maven-enforcer-plugin.version> <!-- overrides parent --> - <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version> <!-- overrides parent --> + <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version> <!-- overrides parent --> <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version> <!-- overrides parent --> - <maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version> <!-- overrides parent --> - <maven-release-plugin.version>3.0.0-M1</maven-release-plugin.version> <!-- overrides parent --> + <maven-javadoc-plugin.version>3.3.1</maven-javadoc-plugin.version> <!-- overrides parent --> + <maven-release-plugin.version>3.0.0-M4</maven-release-plugin.version> <!-- overrides parent --> <maven-remote-resources-plugin.version>[1.7.0,)</maven-remote-resources-plugin.version> <!-- overrides parent --> <maven-source-plugin.version>3.2.1</maven-source-plugin.version> <!-- overrides parent --> <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version> <!-- overrides parent --> <!-- Apache Plugins --> <apache-rat-plugin.version>0.13</apache-rat-plugin.version> <!-- overrides parent --> <!-- org.jacoco Maven Plugins --> - <jacoco-maven-plugin.version>0.8.6</jacoco-maven-plugin.version> + <jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version> <!-- org.eluder Maven Plugins --> <coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version> <!-- other --> <lifecycle-mapping.version>1.0.0</lifecycle-mapping.version> - <git-commit-id-plugin.version>3.0.0</git-commit-id-plugin.version> + <git-commit-id-maven-plugin.version>5.0.0</git-commit-id-maven-plugin.version> </properties> <repositories> @@ -502,9 +502,9 @@ <pluginManagement> <plugins> <plugin> - <groupId>pl.project13.maven</groupId> - <artifactId>git-commit-id-plugin</artifactId> - <version>${git-commit-id-plugin.version}</version> + <groupId>io.github.git-commit-id</groupId> + <artifactId>git-commit-id-maven-plugin</artifactId> + <version>${git-commit-id-maven-plugin.version}</version> <executions> <execution> <goals> @@ -612,7 +612,7 @@ <plugins> <plugin> <groupId>pl.project13.maven</groupId> - <artifactId>git-commit-id-plugin</artifactId> + <artifactId>git-commit-id-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId>
diff --git a/src/main/java/org/apache/datasketches/pig/theta/AexcludeB.java b/src/main/java/org/apache/datasketches/pig/theta/AexcludeB.java index 5619d62..57c2f4f 100644 --- a/src/main/java/org/apache/datasketches/pig/theta/AexcludeB.java +++ b/src/main/java/org/apache/datasketches/pig/theta/AexcludeB.java
@@ -134,8 +134,7 @@ } final AnotB aNOTb = SetOperation.builder().setSeed(seed_).buildANotB(); - aNOTb.update(sketchA, sketchB); - final CompactSketch compactSketch = aNOTb.getResult(true, null); + final CompactSketch compactSketch = aNOTb.aNotB(sketchA, sketchB); return compactOrderedSketchToTuple(compactSketch); }
diff --git a/src/main/java/org/apache/datasketches/pig/theta/DataToSketch.java b/src/main/java/org/apache/datasketches/pig/theta/DataToSketch.java index 434ed1c..bc74bf6 100644 --- a/src/main/java/org/apache/datasketches/pig/theta/DataToSketch.java +++ b/src/main/java/org/apache/datasketches/pig/theta/DataToSketch.java
@@ -544,7 +544,7 @@ // due to system bagged outputs from multiple mapper Intermediate functions. // Each dataTuple.DBA:sketch will merged into the union. final DataByteArray dba = ((DataByteArray) f0); - union.update(Memory.wrap(dba.get())); + union.union(Memory.wrap(dba.get())); } else { // we should never get here.
diff --git a/src/main/java/org/apache/datasketches/pig/theta/Intersect.java b/src/main/java/org/apache/datasketches/pig/theta/Intersect.java index 424f7f0..3a45772 100644 --- a/src/main/java/org/apache/datasketches/pig/theta/Intersect.java +++ b/src/main/java/org/apache/datasketches/pig/theta/Intersect.java
@@ -254,7 +254,7 @@ final DataByteArray dba = (DataByteArray) f0; final Memory srcMem = Memory.wrap(dba.get()); final Sketch sketch = Sketch.wrap(srcMem, seed); - intersection.update(sketch); + intersection.intersect(sketch); } else { throw new IllegalArgumentException( @@ -380,7 +380,7 @@ final DataByteArray dba = (DataByteArray) f0; final Memory srcMem = Memory.wrap(dba.get()); final Sketch sketch = Sketch.wrap(srcMem, mySeed_); - intersection.update(sketch); + intersection.intersect(sketch); } else { // we should never get here. throw new IllegalArgumentException("dataTuple.Field0: Is not a DataByteArray: "
diff --git a/src/main/java/org/apache/datasketches/pig/theta/Union.java b/src/main/java/org/apache/datasketches/pig/theta/Union.java index 3444430..a5129f6 100644 --- a/src/main/java/org/apache/datasketches/pig/theta/Union.java +++ b/src/main/java/org/apache/datasketches/pig/theta/Union.java
@@ -308,7 +308,7 @@ if (type == DataType.BYTEARRAY) { final DataByteArray dba = (DataByteArray) f0; if (dba.size() > 0) { - union.update(Memory.wrap(dba.get())); + union.union(Memory.wrap(dba.get())); } } else { throw new IllegalArgumentException("Field type was not DataType.BYTEARRAY: " + type); @@ -503,7 +503,7 @@ // Each dataTuple.DBA:sketch will merged into the union. final DataByteArray dba = (DataByteArray) f0; final Memory srcMem = Memory.wrap(dba.get()); - union.update(srcMem); + union.union(srcMem); } else { // we should never get here.
diff --git a/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchStats.java b/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchStats.java index 1a43423..003233f 100644 --- a/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchStats.java +++ b/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchStats.java
@@ -20,8 +20,8 @@ package org.apache.datasketches.pig.tuple; import org.apache.commons.math3.stat.descriptive.SummaryStatistics; -import org.apache.datasketches.tuple.ArrayOfDoublesSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesSketchIterator; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketchIterator; class ArrayOfDoublesSketchStats {
diff --git a/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToEstimateAndErrorBounds.java b/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToEstimateAndErrorBounds.java index 000bdd8..7b9891b 100644 --- a/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToEstimateAndErrorBounds.java +++ b/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToEstimateAndErrorBounds.java
@@ -23,8 +23,8 @@ import java.util.Arrays; import org.apache.datasketches.memory.Memory; -import org.apache.datasketches.tuple.ArrayOfDoublesSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesSketches; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches; import org.apache.pig.EvalFunc; import org.apache.pig.data.DataByteArray; import org.apache.pig.data.Tuple;
diff --git a/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToEstimates.java b/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToEstimates.java index ea5a410..f7ff10f 100644 --- a/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToEstimates.java +++ b/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToEstimates.java
@@ -22,9 +22,9 @@ import java.io.IOException; import org.apache.datasketches.memory.Memory; -import org.apache.datasketches.tuple.ArrayOfDoublesSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesSketchIterator; -import org.apache.datasketches.tuple.ArrayOfDoublesSketches; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketchIterator; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches; import org.apache.pig.EvalFunc; import org.apache.pig.data.DataByteArray; import org.apache.pig.data.Tuple;
diff --git a/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToMeans.java b/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToMeans.java index ce624ba..b8abc69 100644 --- a/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToMeans.java +++ b/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToMeans.java
@@ -23,8 +23,8 @@ import org.apache.commons.math3.stat.descriptive.SummaryStatistics; import org.apache.datasketches.memory.Memory; -import org.apache.datasketches.tuple.ArrayOfDoublesSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesSketches; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches; import org.apache.pig.EvalFunc; import org.apache.pig.data.DataByteArray; import org.apache.pig.data.Tuple;
diff --git a/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToNumberOfRetainedEntries.java b/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToNumberOfRetainedEntries.java index 0b2d506..c93a7eb 100644 --- a/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToNumberOfRetainedEntries.java +++ b/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToNumberOfRetainedEntries.java
@@ -22,8 +22,8 @@ import java.io.IOException; import org.apache.datasketches.memory.Memory; -import org.apache.datasketches.tuple.ArrayOfDoublesSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesSketches; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches; import org.apache.pig.EvalFunc; import org.apache.pig.data.DataByteArray; import org.apache.pig.data.Tuple;
diff --git a/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToQuantilesSketch.java b/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToQuantilesSketch.java index c6b879b..619fac6 100644 --- a/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToQuantilesSketch.java +++ b/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToQuantilesSketch.java
@@ -25,9 +25,9 @@ import org.apache.datasketches.quantiles.DoublesSketch; import org.apache.datasketches.quantiles.DoublesSketchBuilder; import org.apache.datasketches.quantiles.UpdateDoublesSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesSketchIterator; -import org.apache.datasketches.tuple.ArrayOfDoublesSketches; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketchIterator; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches; import org.apache.pig.EvalFunc; import org.apache.pig.data.DataByteArray; import org.apache.pig.data.Tuple;
diff --git a/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToVariances.java b/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToVariances.java index 7a4d28a..f514a8a 100644 --- a/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToVariances.java +++ b/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToVariances.java
@@ -23,8 +23,8 @@ import org.apache.commons.math3.stat.descriptive.SummaryStatistics; import org.apache.datasketches.memory.Memory; -import org.apache.datasketches.tuple.ArrayOfDoublesSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesSketches; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches; import org.apache.pig.EvalFunc; import org.apache.pig.data.DataByteArray; import org.apache.pig.data.Tuple;
diff --git a/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchesToPValueEstimates.java b/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchesToPValueEstimates.java index 1e68e08..38b735d 100644 --- a/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchesToPValueEstimates.java +++ b/src/main/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchesToPValueEstimates.java
@@ -24,8 +24,8 @@ import org.apache.commons.math3.stat.descriptive.SummaryStatistics; import org.apache.commons.math3.stat.inference.TTest; import org.apache.datasketches.memory.Memory; -import org.apache.datasketches.tuple.ArrayOfDoublesSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesSketches; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches; import org.apache.pig.EvalFunc; import org.apache.pig.data.DataByteArray; import org.apache.pig.data.Tuple;
diff --git a/src/main/java/org/apache/datasketches/pig/tuple/DataToArrayOfDoublesSketchAlgebraicIntermediateFinal.java b/src/main/java/org/apache/datasketches/pig/tuple/DataToArrayOfDoublesSketchAlgebraicIntermediateFinal.java index 0d2c340..d962a31 100644 --- a/src/main/java/org/apache/datasketches/pig/tuple/DataToArrayOfDoublesSketchAlgebraicIntermediateFinal.java +++ b/src/main/java/org/apache/datasketches/pig/tuple/DataToArrayOfDoublesSketchAlgebraicIntermediateFinal.java
@@ -24,11 +24,11 @@ import java.io.IOException; import org.apache.datasketches.memory.Memory; -import org.apache.datasketches.tuple.ArrayOfDoublesSetOperationBuilder; -import org.apache.datasketches.tuple.ArrayOfDoublesSketches; -import org.apache.datasketches.tuple.ArrayOfDoublesUnion; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketchBuilder; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder; import org.apache.log4j.Logger; import org.apache.pig.EvalFunc; import org.apache.pig.data.DataBag; @@ -92,13 +92,13 @@ new ArrayOfDoublesUpdatableSketchBuilder().setNominalEntries(sketchSize_) .setSamplingProbability(samplingProbability_).setNumberOfValues(numValues_).build(); DataToArrayOfDoublesSketchBase.updateSketch((DataBag) item, sketch, numValues_); - union.update(sketch); + union.union(sketch); } else if (item instanceof DataByteArray) { // This is a sketch from a prior call to the // Intermediate function. merge it with the // current sketch. final DataByteArray dba = (DataByteArray) item; - union.update(ArrayOfDoublesSketches.wrapSketch(Memory.wrap(dba.get()))); + union.union(ArrayOfDoublesSketches.wrapSketch(Memory.wrap(dba.get()))); } else { // we should never get here. throw new IllegalArgumentException("InputTuple.Field0: Bag contains unrecognized types: "
diff --git a/src/main/java/org/apache/datasketches/pig/tuple/DataToArrayOfDoublesSketchBase.java b/src/main/java/org/apache/datasketches/pig/tuple/DataToArrayOfDoublesSketchBase.java index 7461f03..4537edb 100644 --- a/src/main/java/org/apache/datasketches/pig/tuple/DataToArrayOfDoublesSketchBase.java +++ b/src/main/java/org/apache/datasketches/pig/tuple/DataToArrayOfDoublesSketchBase.java
@@ -23,8 +23,8 @@ import java.io.IOException; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketchBuilder; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder; import org.apache.log4j.Logger; import org.apache.pig.Accumulator; import org.apache.pig.EvalFunc;
diff --git a/src/main/java/org/apache/datasketches/pig/tuple/DataToSketchAlgebraicIntermediateFinal.java b/src/main/java/org/apache/datasketches/pig/tuple/DataToSketchAlgebraicIntermediateFinal.java index 749cd74..55d6fba 100644 --- a/src/main/java/org/apache/datasketches/pig/tuple/DataToSketchAlgebraicIntermediateFinal.java +++ b/src/main/java/org/apache/datasketches/pig/tuple/DataToSketchAlgebraicIntermediateFinal.java
@@ -124,13 +124,13 @@ // just insert each item of the tuple into the sketch final UpdatableSketch<U, S> sketch = sketchBuilder_.build(); DataToSketch.updateSketch((DataBag) item, sketch); - union.update(sketch); + union.union(sketch); } else if (item instanceof DataByteArray) { // This is a sketch from a prior call to the // Intermediate function. merge it with the // current sketch. final Sketch<S> incomingSketch = Util.deserializeSketchFromTuple(dataTuple, summaryDeserializer_); - union.update(incomingSketch); + union.union(incomingSketch); } else { // we should never get here. throw new IllegalArgumentException(
diff --git a/src/main/java/org/apache/datasketches/pig/tuple/UnionArrayOfDoublesSketchAlgebraicIntermediateFinal.java b/src/main/java/org/apache/datasketches/pig/tuple/UnionArrayOfDoublesSketchAlgebraicIntermediateFinal.java index 20df310..5664db2 100644 --- a/src/main/java/org/apache/datasketches/pig/tuple/UnionArrayOfDoublesSketchAlgebraicIntermediateFinal.java +++ b/src/main/java/org/apache/datasketches/pig/tuple/UnionArrayOfDoublesSketchAlgebraicIntermediateFinal.java
@@ -24,9 +24,9 @@ import java.io.IOException; import org.apache.datasketches.memory.Memory; -import org.apache.datasketches.tuple.ArrayOfDoublesSetOperationBuilder; -import org.apache.datasketches.tuple.ArrayOfDoublesSketches; -import org.apache.datasketches.tuple.ArrayOfDoublesUnion; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion; import org.apache.log4j.Logger; import org.apache.pig.EvalFunc; import org.apache.pig.data.DataBag; @@ -81,13 +81,13 @@ // this is from a prior call to the initial function, so there is a nested bag. for (final Tuple innerTuple: (DataBag) item) { final DataByteArray dba = (DataByteArray) innerTuple.get(0); - union.update(ArrayOfDoublesSketches.wrapSketch(Memory.wrap(dba.get()))); + union.union(ArrayOfDoublesSketches.wrapSketch(Memory.wrap(dba.get()))); } } else if (item instanceof DataByteArray) { // This is a sketch from a call to the Intermediate function // Add it to the current union final DataByteArray dba = (DataByteArray) item; - union.update(ArrayOfDoublesSketches.wrapSketch(Memory.wrap(dba.get()))); + union.union(ArrayOfDoublesSketches.wrapSketch(Memory.wrap(dba.get()))); } else { // we should never get here. throw new IllegalArgumentException("InputTuple.Field0: Bag contains unrecognized types: "
diff --git a/src/main/java/org/apache/datasketches/pig/tuple/UnionArrayOfDoublesSketchBase.java b/src/main/java/org/apache/datasketches/pig/tuple/UnionArrayOfDoublesSketchBase.java index 2769b4f..7bf4d77 100644 --- a/src/main/java/org/apache/datasketches/pig/tuple/UnionArrayOfDoublesSketchBase.java +++ b/src/main/java/org/apache/datasketches/pig/tuple/UnionArrayOfDoublesSketchBase.java
@@ -24,10 +24,10 @@ import java.io.IOException; import org.apache.datasketches.memory.Memory; -import org.apache.datasketches.tuple.ArrayOfDoublesSetOperationBuilder; -import org.apache.datasketches.tuple.ArrayOfDoublesSketches; -import org.apache.datasketches.tuple.ArrayOfDoublesUnion; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketchBuilder; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder; import org.apache.log4j.Logger; import org.apache.pig.Accumulator; import org.apache.pig.EvalFunc; @@ -116,7 +116,7 @@ continue; } final DataByteArray dba = (DataByteArray) innerTuple.get(0); - union.update(ArrayOfDoublesSketches.wrapSketch(Memory.wrap(dba.get()))); + union.union(ArrayOfDoublesSketches.wrapSketch(Memory.wrap(dba.get()))); } }
diff --git a/src/main/java/org/apache/datasketches/pig/tuple/UnionSketch.java b/src/main/java/org/apache/datasketches/pig/tuple/UnionSketch.java index 1bba6fe..b7dcbe1 100644 --- a/src/main/java/org/apache/datasketches/pig/tuple/UnionSketch.java +++ b/src/main/java/org/apache/datasketches/pig/tuple/UnionSketch.java
@@ -128,7 +128,7 @@ continue; } final Sketch<S> incomingSketch = Util.deserializeSketchFromTuple(innerTuple, summaryDeserializer); - union.update(incomingSketch); + union.union(incomingSketch); } }
diff --git a/src/main/java/org/apache/datasketches/pig/tuple/UnionSketchAlgebraicIntermediateFinal.java b/src/main/java/org/apache/datasketches/pig/tuple/UnionSketchAlgebraicIntermediateFinal.java index 655dd71..64c2512 100644 --- a/src/main/java/org/apache/datasketches/pig/tuple/UnionSketchAlgebraicIntermediateFinal.java +++ b/src/main/java/org/apache/datasketches/pig/tuple/UnionSketchAlgebraicIntermediateFinal.java
@@ -94,13 +94,13 @@ // this is from a prior call to the initial function, so there is a nested bag. for (Tuple innerTuple: (DataBag) item) { final Sketch<S> incomingSketch = Util.deserializeSketchFromTuple(innerTuple, summaryDeserializer_); - union.update(incomingSketch); + union.union(incomingSketch); } } else if (item instanceof DataByteArray) { // This is a sketch from a call to the Intermediate function // Add it to the current union. final Sketch<S> incomingSketch = Util.deserializeSketchFromTuple(dataTuple, summaryDeserializer_); - union.update(incomingSketch); + union.union(incomingSketch); } else { // we should never get here. throw new IllegalArgumentException(
diff --git a/src/test/java/org/apache/datasketches/pig/theta/AexcludeBTest.java b/src/test/java/org/apache/datasketches/pig/theta/AexcludeBTest.java index 6cb6626..5670b66 100644 --- a/src/test/java/org/apache/datasketches/pig/theta/AexcludeBTest.java +++ b/src/test/java/org/apache/datasketches/pig/theta/AexcludeBTest.java
@@ -46,46 +46,18 @@ } @Test - public void checkNullCombinations() throws IOException { + public void test() throws IOException { EvalFunc<Tuple> aNbFunc = new AexcludeB(); EvalFunc<Double> estFunc = new Estimate(); - Tuple inputTuple, resultTuple; - Double est; - //Two nulls - inputTuple = TupleFactory.getInstance().newTuple(2); - resultTuple = aNbFunc.exec(inputTuple); - assertNotNull(resultTuple); - assertEquals(resultTuple.size(), 1); - est = estFunc.exec(resultTuple); - assertEquals(est, 0.0, 0.0); - - //A is null - inputTuple = TupleFactory.getInstance().newTuple(2); - inputTuple.set(1, createDbaFromQssRange(256, 0, 128)); - resultTuple = aNbFunc.exec(inputTuple); - assertNotNull(resultTuple); - assertEquals(resultTuple.size(), 1); - est = estFunc.exec(resultTuple); - assertEquals(est, 0.0, 0.0); - - //A is valid, B is null - inputTuple = TupleFactory.getInstance().newTuple(2); - inputTuple.set(0, createDbaFromQssRange(256, 0, 256)); - resultTuple = aNbFunc.exec(inputTuple); - assertNotNull(resultTuple); - assertEquals(resultTuple.size(), 1); - est = estFunc.exec(resultTuple); - assertEquals(est, 256.0, 0.0); - //Both valid - inputTuple = TupleFactory.getInstance().newTuple(2); + Tuple inputTuple = TupleFactory.getInstance().newTuple(2); inputTuple.set(0, createDbaFromQssRange(256, 0, 256)); inputTuple.set(1, createDbaFromQssRange(256, 0, 128)); - resultTuple = aNbFunc.exec(inputTuple); + Tuple resultTuple = aNbFunc.exec(inputTuple); assertNotNull(resultTuple); assertEquals(resultTuple.size(), 1); - est = estFunc.exec(resultTuple); + Double est = estFunc.exec(resultTuple); assertEquals(est, 128.0, 0.0); }
diff --git a/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToEstimateAndErrorBoundsTest.java b/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToEstimateAndErrorBoundsTest.java index eb83f9d..bb2adfe 100644 --- a/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToEstimateAndErrorBoundsTest.java +++ b/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToEstimateAndErrorBoundsTest.java
@@ -26,8 +26,8 @@ import org.junit.Assert; import org.testng.annotations.Test; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketchBuilder; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder; @SuppressWarnings("javadoc") public class ArrayOfDoublesSketchToEstimateAndErrorBoundsTest {
diff --git a/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToEstimatesTest.java b/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToEstimatesTest.java index 4119f2d..de1253a 100644 --- a/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToEstimatesTest.java +++ b/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToEstimatesTest.java
@@ -26,8 +26,8 @@ import org.apache.pig.data.Tuple; import org.apache.pig.data.TupleFactory; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketchBuilder; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder; @SuppressWarnings("javadoc") public class ArrayOfDoublesSketchToEstimatesTest {
diff --git a/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToMeansTest.java b/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToMeansTest.java index 6e4b2fa..f25ed91 100644 --- a/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToMeansTest.java +++ b/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToMeansTest.java
@@ -28,8 +28,8 @@ import org.testng.Assert; import org.testng.annotations.Test; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketchBuilder; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder; @SuppressWarnings("javadoc") public class ArrayOfDoublesSketchToMeansTest {
diff --git a/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToNumberOfRetainedEntriesTest.java b/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToNumberOfRetainedEntriesTest.java index b22bd1a..f04bf12 100644 --- a/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToNumberOfRetainedEntriesTest.java +++ b/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToNumberOfRetainedEntriesTest.java
@@ -25,8 +25,8 @@ import org.junit.Assert; import org.testng.annotations.Test; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketchBuilder; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder; @SuppressWarnings("javadoc") public class ArrayOfDoublesSketchToNumberOfRetainedEntriesTest {
diff --git a/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToQuantilesSketchTest.java b/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToQuantilesSketchTest.java index bdcd6ed..f873f28 100644 --- a/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToQuantilesSketchTest.java +++ b/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToQuantilesSketchTest.java
@@ -29,8 +29,8 @@ import org.apache.datasketches.memory.Memory; import org.apache.datasketches.quantiles.DoublesSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketchBuilder; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder; @SuppressWarnings("javadoc") public class ArrayOfDoublesSketchToQuantilesSketchTest {
diff --git a/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToVariancesTest.java b/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToVariancesTest.java index ca19415..c7124e7 100644 --- a/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToVariancesTest.java +++ b/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchToVariancesTest.java
@@ -28,8 +28,8 @@ import org.testng.Assert; import org.testng.annotations.Test; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketchBuilder; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder; @SuppressWarnings("javadoc") public class ArrayOfDoublesSketchToVariancesTest {
diff --git a/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchesToPValueEstimatesTest.java b/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchesToPValueEstimatesTest.java index ac2854c..d8d6ba2 100644 --- a/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchesToPValueEstimatesTest.java +++ b/src/test/java/org/apache/datasketches/pig/tuple/ArrayOfDoublesSketchesToPValueEstimatesTest.java
@@ -26,8 +26,8 @@ import org.apache.pig.data.Tuple; import org.apache.pig.data.TupleFactory; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketchBuilder; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder; import org.apache.commons.math3.stat.inference.TTest;
diff --git a/src/test/java/org/apache/datasketches/pig/tuple/DataToArrayOfDoublesSketchTest.java b/src/test/java/org/apache/datasketches/pig/tuple/DataToArrayOfDoublesSketchTest.java index 65f397a..b9a2ed0 100644 --- a/src/test/java/org/apache/datasketches/pig/tuple/DataToArrayOfDoublesSketchTest.java +++ b/src/test/java/org/apache/datasketches/pig/tuple/DataToArrayOfDoublesSketchTest.java
@@ -30,10 +30,10 @@ import org.testng.annotations.Test; import org.apache.datasketches.memory.Memory; -import org.apache.datasketches.tuple.ArrayOfDoublesSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesSketches; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketchBuilder; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder; @SuppressWarnings("javadoc") public class DataToArrayOfDoublesSketchTest {
diff --git a/src/test/java/org/apache/datasketches/pig/tuple/UnionArrayOfDoublesSketchTest.java b/src/test/java/org/apache/datasketches/pig/tuple/UnionArrayOfDoublesSketchTest.java index ca93a98..91b21d0 100644 --- a/src/test/java/org/apache/datasketches/pig/tuple/UnionArrayOfDoublesSketchTest.java +++ b/src/test/java/org/apache/datasketches/pig/tuple/UnionArrayOfDoublesSketchTest.java
@@ -32,10 +32,10 @@ import org.testng.annotations.Test; import org.apache.datasketches.memory.Memory; -import org.apache.datasketches.tuple.ArrayOfDoublesSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesSketches; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketch; -import org.apache.datasketches.tuple.ArrayOfDoublesUpdatableSketchBuilder; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch; +import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder; @SuppressWarnings("javadoc") public class UnionArrayOfDoublesSketchTest {