Spark.TableStatsExample
Spark.TableStatsExample copied to clipboard
Fix for the TopNList add method
The original would only add the first N key-values encountered
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.