Open
Description
Currently creating mapping between aliases and actual tables names is performed globally for whole SQL, what is not correct for more complicated once.
Lets consider following SQL taken directly from SPIDER (there are more queries like this):
SELECT T1.asset_id , T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING count(*) = 2
INTERSECT
SELECT T1.asset_id , T1.asset_details FROM Assets AS T1 JOIN Fault_Log AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING count(*) < 2
First subquery maps T2
to Asset_Parts
, but second subquery maps T2
to Fault_Log
. Current evaluation script is not able to handle this. It may allow false positives to pass and throw exceptions because script is searching for column in wrong table.
Relevant code fragment:
test-suite-sql-eval/process_sql.py
Lines 150 to 156 in e97acc5
Metadata
Metadata
Assignees
Labels
No labels