hue_run_query_to_csv
Execute SQL queries and export results directly to CSV files for data analysis or reporting. This tool runs queries using Hive, SparkSQL, or Impala and saves the output as CSV.
Instructions
Execute a SQL query and save results directly to a CSV file.
This is a convenience method that combines query execution with CSV export.
Ideal for exporting large result sets to files.
Args:
statement: The SQL statement to execute
filename: Output CSV filename (default: 'results.csv')
dialect: SQL dialect - 'hive', 'sparksql', or 'impala' (default: 'hive')
batch_size: Number of rows to fetch per batch (default: 1000)
Returns:
OperationResult indicating success and the output filename
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| statement | Yes | ||
| filename | No | results.csv | |
| dialect | No | hive | |
| batch_size | No |