Spark.TableStatsExample icon indicating copy to clipboard operation
Spark.TableStatsExample copied to clipboard

Fix for the TopNList add method

Open finleysg opened this issue 8 years ago • 1 comments

The original would only add the first N key-values encountered

finleysg avatar Mar 29 '16 14:03 finleysg

In the original, the top N members of the array would simply be the first N to arrive because the second block:

else if (topNCountsForColumnArray.length == maxSize)

would never allow the thread to get to the third block.

The third block also used a .insert() method rather than a .update() method, so if we did reach that block, we would run out of heap memory on a large table.

finleysg avatar Mar 29 '16 14:03 finleysg