NDV Function
An aggregate function that returns an approximate value similar to the result of
COUNT(DISTINCT
col), the
This is the mechanism used internally by the COMPUTE STATS statement for computing the number of distinct values in a column.
Usage notes:
Because this number is an estimate, it might not reflect the precise number of different values in the column, especially if the cardinality is very low or very high. If the estimated number is higher than the number of rows in the table, Impala adjusts the value internally during query planning.
Currently, the return value is always a STRING. The return type is subject to change in future releases. Always use CAST() to convert the result to whichever data type is appropriate for your computations.
<< MIN Function | STDDEV, STDDEV_SAMP, STDDEV_POP Functions >> | |