get_column_info
Compute per-column statistical profiles for a table, including row counts, distinct counts, null percentages, and type-specific stats, to assess data quality and distribution.
Instructions
Retrieve per-column statistical profiles for a table.
EXPERIMENTAL — Statistics are based on common practices but have not been battle-tested for utility. Use as a starting point for investigation, not as definitive answers.
Computes row counts, distinct counts, null counts/percentages, and type-specific statistics for each column. Numeric columns get min/max/mean/stddev. Datetime columns get min/max dates, range in days, and whether a time component is present. String columns get min/max/avg length and a sample of top frequent values.
Args: connection_id: Connection ID from connect_database table_name: Name of the table. May be dotted (e.g. 'schema.table' or 'catalog.schema.table') and is resolved against the dialect. schema_name: Schema name. Defaults to the dialect's default schema (e.g. 'dbo' on MSSQL) when omitted. columns: Explicit list of column names to analyze (takes precedence over pattern) column_pattern: SQL LIKE pattern to filter column names (e.g., '%_id') sample_size: Number of top frequent value samples for string columns (default: 10) catalog: Optional Databricks catalog name. Rejected on non-Databricks dialects (returns an error response). On Databricks the catalog is threaded end-to-end: the existence check and column statistics are computed against the requested catalog (cross-catalog supported via catalog-scoped reflection — IDENT-08).
Returns: TOON-encoded string with status, table/schema metadata, and column statistics:
status: "success" | "error"
table_name: string // on success only
schema_name: string // on success only
total_columns_analyzed: int // on success only
columns: list // on success only
column_name: string
data_type: string
total_rows: int
distinct_count: int
distinct_count_approximate: bool // true = HLL-approximate (Databricks fast path)
null_count: int
null_percentage: float
numeric_stats: object // numeric columns only
min_value: float | null
max_value: float | null
mean_value: float | null
std_dev: float | null
datetime_stats: object // datetime columns only
min_date: ISO 8601 string | null
max_date: ISO 8601 string | null
date_range_days: int | null
has_time_component: bool
string_stats: object // string columns only
min_length: int | null
max_length: int | null
avg_length: float | null
sample_values: list of [string, int] pairs
error_message: string // on error onlyError conditions: - Invalid connection_id: returns status "error" with error_message - Table not found: returns status "error" with error_message - Column not found (explicit list): returns status "error" with error_message - No columns match pattern: returns status "success" with empty columns list
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| catalog | No | ||
| columns | No | ||
| table_name | Yes | ||
| sample_size | No | ||
| schema_name | No | ||
| connection_id | Yes | ||
| column_pattern | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |