columnDistribution
columnDistributionAnalyze a column's value distribution by returning top-N values, their counts, and row shares to identify frequency and skew in a table.
Instructions
Measure value frequency and skew for one known column by returning top-N values, counts and row shares. Use columnStats for only cardinality/extremes; runs GROUP BY + COUNT and may be expensive on large tables.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topN | No | Top values to return (default 20, max 1000). | |
| table | Yes | ||
| column | Yes | ||
| schema | No | ||
| connection | Yes | Database to run against. Call listConnections for valid names; do not guess. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topN | Yes | Maximum number of most-frequent values requested for the distribution. | |
| table | No | ||
| column | No | Column whose value frequencies were measured. | |
| schema | No | ||
| values | No | Most frequent values and their frequencies for the column. | |
| topRows | Yes | Rows covered by the returned top-N value buckets. | |
| topRatio | Yes | Share of all rows covered by the returned top-N buckets, from 0.0 to 1.0. | |
| otherRows | Yes | Rows not represented by the returned top-N value buckets. | |
| totalRows | Yes | Total number of rows considered for this statistic. | |
| otherRatio | Yes | Share of all rows outside the returned top-N buckets, from 0.0 to 1.0. |