# Package org.apache.datasketches.hive.tuple

Hive UDFs for Tuple sketches. Tuple sketches are based on the idea of Theta sketches with the addition of values associated with unique keys. Two sets of tuple sketch classes are available at the moment: generic Tuple sketches with user-defined Summary, and a faster specialized implementation with an array of double values.

There are two sets of Hive UDFs: one for generic Tuple sketch with an example implementation for DoubleSummay, and another one for a specialized ArrayOfDoublesSketch.

The generic implementation is in the form of abstract classes DataToSketchUDAF and UnionSketchUDAF to be specialized for particular types of Summary. An example implementation for DoubleSumamry is provided: DataToDoubleSummarySketchUDAF and UnionDoubleSummarySketchUDAF, as well as UDFs to obtain the results from sketches: DoubleSumamrySketchToEstimatesUDF and DoubleSummarySketchToPercentileUDF.

UDFs for ArrayOfDoublesSketch: DataToArrayOfDoublesSketchUDAF, UnionArrayOfDoublesSketchUDAF, ArrayOfDoublesSketchToEstimatesUDF, ArrayOfDoublesSketchToValuesUDTF.

Author:
  Alexander Saydakov

Class Summary
ArrayOfDoublesSketchesTTestUDF
ArrayOfDoublesSketchToEstimateAndErrorBoundsUDF
ArrayOfDoublesSketchToEstimatesUDF
ArrayOfDoublesSketchToMeansUDF
ArrayOfDoublesSketchToNumberOfRetainedEntriesUDF
ArrayOfDoublesSketchToQuantilesSketchUDF
ArrayOfDoublesSketchToValuesUDTF
ArrayOfDoublesSketchToVariancesUDF
DataToArrayOfDoublesSketchUDAF
DataToArrayOfDoublesSketchUDAF.DataToArrayOfDoublesSketchEvaluator
DataToDoubleSummarySketchUDAF: This simple implementation is to give an example of a concrete UDAF based on the abstract DataToSketchUDAF if no extra arguments are needed.
DataToDoubleSummaryWithModeSketchUDAF: This is an example of a concrete UDAF based on the abstract DataToSketchUDAF if extra arguments are needed.
DataToSketchUDAF: Note Strings as raw data values are encoded as a UTF-16 VARCHAR prior to being submitted to the sketch.
DataToSketchUDAF.DataToSketchEvaluator<U,​S extends org.apache.datasketches.tuple.UpdatableSummary<U>>
DoubleSummarySketchToEstimatesUDF
DoubleSummarySketchToPercentileUDF
UnionArrayOfDoublesSketchUDAF
UnionArrayOfDoublesSketchUDAF.UnionArrayOfDoublesSketchEvaluator
UnionDoubleSummarySketchUDAF: This simple implementation is to give an example of a concrete UDAF based on the abstract UnionSketchUDAF if no extra arguments are needed..
UnionDoubleSummarySketchUDAF.UnionDoubleSummarySketchEvaluator
UnionDoubleSummaryWithModeSketchUDAF: This is an example of a concrete UDAF based on the abstract UnionSketchUDAF if extra arguments are needed.
UnionDoubleSummaryWithModeSketchUDAF.UnionDoubleSummaryWithModeSketchEvaluator
UnionSketchUDAF: Generic implementation to be sub-classed with a particular type of Summary
UnionSketchUDAF.UnionSketchEvaluator<S extends org.apache.datasketches.tuple.Summary>