process_sql
genlm.eval.domains.spider.spider_eval.process_sql
Schema
Simple schema which maps table&column to a unique identifier
Source code in genlm/eval/domains/spider/spider_eval/process_sql.py
get_schema(db)
Get database's schema, which is a dict with table name as key and list of column names as value :param db: database path :return: schema dict
Source code in genlm/eval/domains/spider/spider_eval/process_sql.py
scan_alias(toks)
Scan the index of 'as' and build the map for all alias
Source code in genlm/eval/domains/spider/spider_eval/process_sql.py
parse_col(toks, start_idx, tables_with_alias, schema, default_tables=None)
:returns next idx, column id
Source code in genlm/eval/domains/spider/spider_eval/process_sql.py
parse_col_unit(toks, start_idx, tables_with_alias, schema, default_tables=None)
:returns next idx, (agg_op id, col_id)
Source code in genlm/eval/domains/spider/spider_eval/process_sql.py
parse_table_unit(toks, start_idx, tables_with_alias, schema)
:returns next idx, table id, table name
Source code in genlm/eval/domains/spider/spider_eval/process_sql.py
parse_from(toks, start_idx, tables_with_alias, schema)
Assume in the from clause, all table units are combined with join