apache / datasketches-java

A software library of stochastic streaming algorithms, a.k.a. sketches.

Home Page:https://datasketches.apache.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tuple.QuickSelectSketch throws NullPointerException

kellanburket opened this issue · comments

I'm running into this NullPointerException error when getting results for a tuple.Union:

java.lang.NullPointerException
at com.yahoo.sketches.tuple.QuickSelectSketch.rebuild(QuickSelectSketch.java:434)
at com.yahoo.sketches.tuple.QuickSelectSketch.rebuild(QuickSelectSketch.java:409)
at com.yahoo.sketches.tuple.Union.getResult(Union.java:65)

After reading the source code for tuple.QuickSelectSketch, this seems to be linked to a null "summaries_" array.

I'm having difficulty diagnosing the problem because it doesn't seem to affect every getResult operation, only a few of them. The only similarity I can see is that the failing Unions have a single tuple.CompactSketch with 0 retained entries and a theta less than 1.0--though some Unions with a tuple.CompactSketch with 0 retained entries and a theta less than 1.0 don't fail.

The code is something like:

val union = new Union(k, summarySetOperations)
union.update(sketch)
union.getResult

What version of the java library are you using?

That is pretty old. Could you upgrade to 1.1.0 ? (now in Apache) ?

Testing on the latest version indicates that there is an issue here, so updating won't fix it.

I think we have found the problem. I did want to ask how you ended up with an input sketch with 0 values and a theta < 1.0. You had to be doing an Intersection or using the p-sampling mode. Yes?

We should have a fix on the Apache github late today or tomorrow, but we won't have new Jars released to Maven Central for at least a week. If you need a fix sooner than that you can do a diff and apply the fix yourself. Will that work for you?

Intersections.

I'll wait for the update to maven. Thanks for looking into this so quickly.

Hi, just checking in. Does 1.2.0-incubating on maven have the latest jars?

Yes.
You can read the release notes here