Get Table Info
get_table_infoRetrieve table metadata including columns, summary detection, and merge functions to prevent query errors.
Instructions
Get detailed metadata for a specific table including columns and summary table detection.
REQUIRED USAGE: Call this tool BEFORE querying ANY table to check if it's a summary table and get column metadata. This is mandatory to avoid query errors.
This tool provides:
is_summary_table: Boolean indicating if table has pre-aggregated data
columns: List of column objects, each with a column_category field:
column_category='Column': plain dimension column
column_category='AliasColumn': non-aggregate ALIAS column, has default_expr
column_category='AggregateColumn': AggregateFunction/SimpleAggregateFunction type, has base_function and merge_function
column_category='SummaryColumn': ALIAS column that transitively depends on aggregates, has default_expr
summary_table_info: Human-readable description for summary tables
total_rows, total_bytes: Table statistics
WORKFLOW for querying tables:
Call get_table_info('database', 'table_name')
Check is_summary_table field
If is_summary_table=True:
Read column_category and merge_function for each column
Use merge_function to wrap aggregate columns in queries
Example: SELECT countMerge(
count(vendor_id)) FROM table
If is_summary_table=False:
Use standard SQL (SELECT count(*), sum(col), etc.)
Execute query with run_select_query
For summary tables, aggregate columns MUST be wrapped with their corresponding -Merge functions from the merge_function field. Querying without checking this metadata first will cause errors.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | Yes | ||
| table | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||