Skip to content

Diagnostics functions in the VGI DuckDB extension

Function category

Diagnostics

2 functions

Look under the hood of a VGI table — its per-column statistics and, for multi-branch tables, the branches it declares.

vgi_table_branches

Table function Diagnostics
Signature
vgi_table_branches() None
Returns

A table with the following columns:

Column catalog_name Type VARCHAR Description Catalog of the multi-branch table.
Column schema_name Type VARCHAR Description Schema of the multi-branch table.
Column table_name Type VARCHAR Description Name of the multi-branch table.
Column branch_index Type BIGINT Description Zero-based index of the branch within the table.
Column function_name Type VARCHAR Description Worker-side function that backs this branch.
Column positional_arguments Type JSON Description Positional arguments bound to the branch, as JSON.
Column named_arguments Type JSON Description Named arguments bound to the branch, as JSON.
Column branch_filter Type VARCHAR Description Filter expression that selects this branch, or NULL when unset.
Column table_required_extensions Type VARCHAR[] Description DuckDB extensions the branch requires to be loaded.
Column writable Type BOOLEAN Description Whether the branch is declared as an INSERT target for multi-branch writes.
Description
1 Example 1
SELECT * FROM vgi_table_branches();

vgi_table_statistics

Table function Diagnostics
Signature
vgi_table_statistics( catalog: VARCHAR, schema: VARCHAR, table: VARCHAR ) None
Arguments (Positional)
Argument catalog Type VARCHAR Mode Positional Description
Argument schema Type VARCHAR Mode Positional Description
Argument table Type VARCHAR Mode Positional Description
Returns

A table with the following columns:

Column column_name Type VARCHAR Description Name of the column this statistics row describes.
Column column_type Type VARCHAR Description DuckDB type of the column.
Column min Type UNION Description Minimum value DuckDB holds for the column, in the column's own type (NULL when unknown).
Column max Type UNION Description Maximum value DuckDB holds for the column, in the column's own type (NULL when unknown).
Column has_null Type BOOLEAN Description Whether the statistics indicate the column may contain NULLs.
Column has_not_null Type BOOLEAN Description Whether the statistics indicate the column has at least one non-NULL value.
Column distinct_count Type BIGINT Description Approximate number of distinct values (HyperLogLog estimate), or NULL if unavailable.
Column contains_unicode Type BOOLEAN Description For string columns, whether values may contain non-ASCII characters.
Column max_string_length Type UBIGINT Description For string columns, the maximum byte length observed.
Description
1 Example 1
SELECT * FROM vgi_table_statistics('mycatalog', 'main', 'events');