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

jmalkin pushed a commit to branch java_version_update
in repository https://gitbox.apache.org/repos/asf/datasketches-hive.git


The following commit(s) were added to refs/heads/java_version_update by this 
push:
     new 53cdaee  WIP (forgot to note before): fix failing tuple sketch test
53cdaee is described below

commit 53cdaee26ae7b0fcaf85f603dc8b163cc3a4f19d
Author: Jon <[email protected]>
AuthorDate: Mon May 13 23:29:56 2024 -0700

    WIP (forgot to note before): fix failing tuple sketch test
---
 .../datasketches/hive/tuple/DoubleSummarySketchToPercentileUDF.java      | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/src/main/java/org/apache/datasketches/hive/tuple/DoubleSummarySketchToPercentileUDF.java
 
b/src/main/java/org/apache/datasketches/hive/tuple/DoubleSummarySketchToPercentileUDF.java
index d0dd87c..875688f 100644
--- 
a/src/main/java/org/apache/datasketches/hive/tuple/DoubleSummarySketchToPercentileUDF.java
+++ 
b/src/main/java/org/apache/datasketches/hive/tuple/DoubleSummarySketchToPercentileUDF.java
@@ -61,6 +61,7 @@ public class DoubleSummarySketchToPercentileUDF extends UDF {
     }
     final Sketch<DoubleSummary> sketch =
         
Sketches.heapifySketch(BytesWritableHelper.wrapAsMemory(serializedSketch), 
SUMMARY_DESERIALIZER);
+    if (sketch.isEmpty()) { return Double.NaN; }
     final UpdateDoublesSketch qs = 
DoublesSketch.builder().setK(QUANTILES_SKETCH_K).build();
     final TupleSketchIterator<DoubleSummary> it = sketch.iterator();
     while (it.next()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to