taoyds / spider

scripts and baselines for Spider: Yale complex and cross-domain semantic parsing and text-to-SQL challenge
https://yale-lily.github.io/spider
Apache License 2.0
848 stars 193 forks source link

Reverse script of process_sql.py #34

Closed zhaoyizhaoyi closed 4 years ago

zhaoyizhaoyi commented 5 years ago

Dear Tao Yu, Thanks for your data! Well, since you provide the script to process the sql query string into a formatted json object, I wonder if you also have a standardized script to reverse that process? That is, given a parsed sql json file like follows, do you have the script to convert it back into a sql query string "SELECT avg(LifeExpectancy) FROM country WHERE Name NOT IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"English\" AND T2.IsOfficial = \"T\")"?


            "except": null,
            "from": {
                "conds": [],
                "table_units": [
                    ...
            },
            "groupBy": [],
            "having": [],
            "intersect": null,
            "limit": null,
            "orderBy": [],
            "select": [
                ...
            ],
         ...
    }```
    Or, do you also have a evaluation script that compare two sqls based on their parsed json files?
    Thanks in advance. 
Best Regards,
Yi Zhao
Meidan commented 4 years ago

@zhaoyizhaoyi have you ended up implementing the reverse script by any chance?

zhaoyizhaoyi commented 4 years ago

@Meidan No, I haven't. Actually, I am expecting such a script from the authors of Spider as the official standard.

taoyds commented 4 years ago

We don't provide the reverse script.

shabbie commented 1 year ago

By any chance, has the requested script been developed by anyone?

@Meidan No, I haven't. Actually, I am expecting such a script from the authors of Spider as the official standard.

Has the script been implemented by any chance?