Connects to databases and executes generated SQL queries to fetch results.
Output
execute_sql
method returns a dictionary with the following keys
result
: The result of the SQL query execution.error
: Any error that occurred during the execution.execution_time
: The time taken to execute the SQL query.match_sqls()
to match the generated SQL with the ground truth SQL.iterated_execution()
to execute the SQL iteratively and comparing with the ground truth to see the execution time ratio.Output
BaseExecutor
class and implementing the execute_sql
method. Hereβs an example of a custom executor for a PostgreSQL database:
Text2SQLEvaluator
in the next section.