layout: doc_page

Sketches by Component Repository

The DataSketches Library is organized into the following repository groups:

Java

datasketches-java

This repository has the core-java sketching classes, which are leveraged by some of the other repositories.
This repository has no external dependencies outside of the DataSketches/memory repository, Java and TestNG for unit tests. This code is versioned and the latest release can be obtained from Downloads.

High-level Repositories Structure

Sketches-core Packages.Package Description
org.apache.datasketchesCommon functions and utilities
org.apache.datasketches.cpcNew Unique Counting Sketch with better accuracy per size than HLL
org.apache.datasketches.fdtFrequent Distinct Tuples Sketch.
org.apache.datasketches.frequenciesFrequent Item Sketches, for both longs and generics
org.apache.datasketches.hashThe 128-bit MurmurHash3 and adaptors
org.apache.datasketches.hllUnique counting HLL sketches for both heap and off-heap.
org.apache.datasketches.hllmapThe (HLL) Unique Count Map Sketch
org.apache.datasketches.kllQuantiles sketch with better accuracy per size than the standard quantiles sketch. Includes PMF, CDF functions, for floats, doubles. On-heap & off-heap.
org.apache.datasketches.quantilesStandard Quantiles sketch, plus PMF and CDF functions, for doubles and generics. On-heap & off-heap.
org.apache.datasketches.reqRelative Error Quantiles (REQ) sketch, plus PMF and CDF functions for floats, on-heap. Extremely high accuracy for very high ranks (e.g., 99.999%ile), or very low ranks (e.g., .00001%ile.
org.apache.datasketches.samplingWeighted and uniform reservoir sampling with generics
org.apache.datasketches.thetaUnique counting Theta Sketches for both on-heap & off-heap
org.apache.datasketches.tupleTuple sketches for both primitives and generics
org.apache.datasketches.tuple.adoubleA Tuple sketch with a Summary of a single double
org.apache.datasketches.tuple.anintegerA Tuple sketch with a Summary of a single integer
org.apache.datasketches.tuple.StringsA Tuple sketch with a Summary of an array of Strings

datasketches-memory

This code is versioned and the latest release can be obtained from Downloads.

Memory PackagesPackage Description
org.apache.datasketches.memoryLow level, high-performance Memory data-structure management primarily for off-heap.

datasketches-hive

This repository contains Hive UDFs and UDAFs for use within Hadoop grid enviornments. This code has dependencies on sketches-core as well as Hadoop and Hive. Users of this code are advised to use Maven to bring in all the required dependencies. This code is versioned and the latest release can be obtained from Downloads.

Sketches-hive PackagesPackage Description
org.apache.datasketches.hive.cpcHive UDF and UDAFs for CPC sketches
org.apache.datasketches.hive.frequenciesHive UDF and UDAFs for Frequent Items sketches
org.apache.datasketches.hive.hllHive UDF and UDAFs for HLL sketches
org.apache.datasketches.hive.kllHive UDF and UDAFs for KLL sketches
org.apache.datasketches.hive.quantilesHive UDF and UDAFs for Quantiles sketches
org.apache.datasketches.hive.thetaHive UDF and UDAFs for Theta sketches
org.apache.datasketches.hive.tupleHive UDF and UDAFs for Tuple sketches

datasketches-pig

This repository contains Pig User Defined Functions (UDF) for use within Hadoop grid environments. This code has dependencies on sketches-core as well as Hadoop and Pig. Users of this code are advised to use Maven to bring in all the required dependencies. This code is versioned and the latest release can be obtained from Downloads.

Sketches-pig PackagesPackage Description
org.apache.datasketches.pig.cpcPig UDFs for CPC sketches
org.apache.datasketches.pig.frequenciesPig UDFs for Frequent Items sketches
org.apache.datasketches.pig.hashPig UDFs for MurmerHash3
org.apache.datasketches.pig.hllPig UDFs for HLL sketches
org.apache.datasketches.pig.kllPig UDFs for KLL sketches
org.apache.datasketches.pig.quantilesPig UDFs for Quantiles sketches
org.apache.datasketches.pig.sampling.Pig UDFs for Sampling sketches
org.apache.datasketches.pig.thetaPig UDFs for Theta sketches
org.apache.datasketches.pig.tuplePig UDFs for Tuple sketches

datasketches-characterization

This relatively new repository is for Java and C++ code that we use to characterize the accuracy and speed performance of the sketches in the library and is constantly being updated. Examples of the job command files used for various tests can be found in the src/main/resources directory. Some of these tests can run for hours depending on its configuration. This component is not formally released and code must be obtained from the GitHub site.

Characterization PackagesPackage Description
org.apache.datasketches.characterizationCommon functions and utilities
org.apache.datasketches.characterization.concurrentConcurrent Theta Sketch
org.apache.datasketches.characterization.cpcCompressed Probabilistic Counting Sketch
org.apache.datasketches.characterization.fdtFrequent Distinct Tuples Sketch
org.apache.datasketches.characterization.frequenciesFrequent Items Sketches
org.apache.datasketches.characterization.hashHash function performance
org.apache.datasketches.characterization.hllHyperLogLog Sketcch
org.apache.datasketches.characterization.memoryMemory performance
org.apache.datasketches.characterization.quantilesQuantiles performance
org.apache.datasketches.characterization.thetaTheta Sketch
org.apache.datasketches.characterization.uniquecountBase Profiles for Unique Counting Sketches

datasketches-server

This is a new repository for our experimental docker/container server that enables easy access to the core sketches in the library via HTTP. This component is not formally released and code must be obtained from the GitHub site.

C++ Characterizations

  • CPC
  • Frequent Items
  • HLL
  • KLL
  • Theta

datasketches-vector

This component implements the Frequent Directions Algorithm [GLP16]. It is still experimental in that the theoretical work has not yet supplied a suitable measure of error for production work. It can be used as is, but it will not go through a formal Apache Release until we can find a way to provide better error properties. It has a dependence on the Memory component. This component is not formally released and code must be obtained from the GitHub site.

C++ and Python

datasketches-cpp

This is the evolving C++ implementations of the same sketches that are available in Java. These implementations are binary compatible with their counterparts in Java. In other words, a sketch created and stored in C++ can be opened and read in Java and visa-versa. This code is versioned and the latest release can be obtained from Downloads.

This site also has our Python adaptors that basically wrap the C++ implementations, making the high performance C++ implementations available from Python.

datasketches-postgresql

This site provides the postgres-specific adaptors that wrap the C++ implementations making them available to the PostgreSQL database users. PostgreSQL users should download the PostgreSQL extension from pgxn.org. For examples refer to the README on the component site. This code is versioned and the latest release can be obtained from Downloads.