get_sql_table_schema
Retrieve the schema, sample data, and row count of a parquet file to analyze its structure before querying. Ideal for understanding columns, data types, and preparing SQL queries efficiently.
Instructions
Get the schema and sample data for a specific parquet file
WORKFLOW NOTE: Use this function to explore the structure of parquet files
before writing SQL queries against them. This will show you:
1. All available columns and their data types
2. Sample data from the file
3. Total row count
Usage example:
1. Get list of files: files = list_available_sql_tables()
2. For a specific file: schema = get_sql_table_schema(files[0]['path'])
3. Use columns in your SQL: query_sql("SELECT column1, column2 FROM read_parquet('/path/to/file.parquet')")
Args:
file_path: Path to the parquet file (from list_available_sql_tables or query_dataset)
Returns:
Table schema information including columns, data types, and sample data
Input Schema
Name | Required | Description | Default |
---|---|---|---|
file_path | Yes |
Input Schema (JSON Schema)
{
"properties": {
"file_path": {
"title": "File Path",
"type": "string"
}
},
"required": [
"file_path"
],
"title": "get_sql_table_schemaArguments",
"type": "object"
}