FrequentStringsSketch
This section contains reference documentation for the FREQUENTSTRINGSSKETCH function.
Signature
Usage Example
select FREQUENTSTRINGSSKETCH(AirlineID, 16) from airlineStatsfrequentstringssketch(AirlineID)
byte[] byteArr = Base64.getDecoder().decode(encodedSketch);
ItemsSketch<String> sketch = ItemsSketch.getInstance(Memory.wrap(byteArr), new ArrayOfStringsSerDe());
ItemsSketch.Row[] items = sketch.getFrequentItems(ErrorType.NO_FALSE_NEGATIVES);
for (int i = 0; i < items.length; i++) {
ItemsSketch.Row item = items[i];
System.out.printf("Airline: %s, Frequency: %d %n", item.getItem(), item.getEstimate());
}Was this helpful?

