Package org.apache.sysds.runtime.matrix.data.sketch.countdistinct

# Class CountDistinctFunctionSketch

java.lang.Object
org.apache.sysds.runtime.matrix.data.sketch.CountDistinctSketch
org.apache.sysds.runtime.matrix.data.sketch.countdistinct.CountDistinctFunctionSketch

All Implemented Interfaces:
  `MatrixSketch`

public class CountDistinctFunctionSketch extends CountDistinctSketch

## Field Summary

### Fields inherited from class org.apache.sysds.runtime.matrix.data.sketch.CountDistinctSketch

`op`

## Constructor Summary

Constructors
Constructor
Description
`CountDistinctFunctionSketch(Operator op)`

## Method Summary

Modifier and Type
Method
Description
`CorrMatrixBlock`
`create(MatrixBlock blkIn)`
Create an initial sketch of a given block.
`MatrixBlock`
`getValue(MatrixBlock blkIn)`
Get scalar distinct count from an input matrix block.
`MatrixBlock`
`getValueFromSketch(CorrMatrixBlock blkIn)`
Obtain matrix distinct count value from estimation Used for estimating distinct in rows or columns.
`CorrMatrixBlock`
`intersection(CorrMatrixBlock arg0, CorrMatrixBlock arg1)`
Intersect two sketches
`CorrMatrixBlock`
`union(CorrMatrixBlock arg0, CorrMatrixBlock arg1)`
Union two sketches together to from a combined sketch.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### CountDistinctFunctionSketch

public CountDistinctFunctionSketch(Operator op)

## Method Details

### getValue

public MatrixBlock getValue(MatrixBlock blkIn)
Description copied from interface: `MatrixSketch`
Get scalar distinct count from an input matrix block.

Parameters:
  `blkIn` - An input block to estimate the number of distinct values in
Returns:
  The result matrix block containing the distinct count estimate

### getValueFromSketch

public MatrixBlock getValueFromSketch(CorrMatrixBlock blkIn)
Description copied from interface: `MatrixSketch`
Obtain matrix distinct count value from estimation Used for estimating distinct in rows or columns.

Parameters:
  `blkIn` - The sketch block to extract the count from
Returns:
  The result matrix block

### create

public CorrMatrixBlock create(MatrixBlock blkIn)
Description copied from interface: `MatrixSketch`
Create an initial sketch of a given block.

Parameters:
  `blkIn` - A block to process
Returns:
  A sketch

### union

public CorrMatrixBlock union(CorrMatrixBlock arg0, CorrMatrixBlock arg1)
Description copied from interface: `MatrixSketch`
Union two sketches together to from a combined sketch.

Parameters:
  `arg0` - Sketch one
  `arg1` - Sketch two
Returns:
  The sketch union is a sketch

### intersection

public CorrMatrixBlock intersection(CorrMatrixBlock arg0, CorrMatrixBlock arg1)
Description copied from interface: `MatrixSketch`
Intersect two sketches

Parameters:
  `arg0` - Sketch one
  `arg1` - Sketch two
Returns:
  The sketch intersection is a sketch