Proposal to upgrade TARGET's text-2-sql dataset schema
#3
by
jixy2012
- opened
as we are thinking about incorporating BEAVER and other large-scale datasets, I'm making this dataset schema update proposal to ensure future extensibility of text-2-sql datasets.
Problems
- Larger Tables: previously, we made the assumption that tables aren't that big -- which worked very well for fetaqa, ottqa, and even spider1.0. However, this assumption is breaking down for new text-2-sql datasets. DW subset of Beaver for example has 42% of tables (39 out of 93) with over 10k rows and spider has 37% (28 out of 75). putting all table contents in the main dataset file seems a bit unreasonable for memory and loading efficiency.
- Redundant Storage: tables are already stored in sql dbs (sqlite or mysql) for these datasets. eval relies on executing generated sql so these db files are needed anyways. storing the table contents again in the main dataset file means we are storing each table twice
- Missing /Messy Schema Information: we have previously stuffed all auxiliary information in the "context" column. it is unclear what the context contains from dataset to dataset, as there's no enforced format there. as we iterate on retrieval methods, we are trying to make the best use of such auxiliary information, including data types and join keys. iterating on how "context" is organized will allow us to include such info more effectively.
Proposed Changes
- Include only sample rows from tables in the main dataset file: instead of stuffin in the entire 50k rows of a table, include a subsample of 100.
- Update context: Add column types (list enum), primary key (list str), foreign key(list(tuple[referenced_table, referenced_column])), description(list str)
- Provide interface to interact with underlying sqlite db for access to full tables: provide retrievers with an object that allows them to retrieve full table contents if needed. for example specifying a table and a db and returns the entire table.
- Keep other datasets as is: other datasets are OKAY and tbh probably won't play nicely if we tried to stuff them into sqlite dbs. there's no need to really change them drastically. due to the special nature of text-2-sql, i think it's reasonable to have the interfaces slightly different from each other.
edit: update update context to:
Update context: Add column types (list enum), primary key (list str), foreign keys(list(tuple[referenced_table, referenced_column])), descriptions(list str), original column names (list str)