run_query_to_csv
Execute SQL SELECT queries on a Bauplan data catalog table and save results to a CSV file, providing the output file path.
Instructions
Execute SQL SELECT queries on a specified table in the user's Bauplan data catalog, saving results to a CSV file, using a query and table name, returning a file path. Execute SELECT queries and save results directly to CSV file.
Note: CSV format only supports scalar data types (strings, numbers, booleans). Queries returning complex types (arrays, lists, nested objects) will fail. For complex data, use run_query tool instead or modify SQL to flatten/convert data.
Args: path: Output CSV file path where results will be saved. query: SQL query to execute (DuckDB SQL syntax). ref: Branch/reference to query against (optional). namespace: Namespace to use (optional). client_timeout: Timeout in seconds (defaults to 120).
Returns: QueryToCSVResult: Object indicating success/failure with execution details
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| query | Yes | ||
| ref | No | ||
| namespace | No | ||
| client_timeout | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| query | Yes | ||
| ref | Yes | ||
| namespace | Yes | ||
| success | Yes | ||
| message | Yes |