Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't support inner join #14

Open
nuoma opened this issue Apr 26, 2023 · 0 comments
Open

Doesn't support inner join #14

nuoma opened this issue Apr 26, 2023 · 0 comments

Comments

@nuoma
Copy link

nuoma commented Apr 26, 2023

Hi, many thanks in advance! I'm trying to create a new and complex NL2SQL dataset, however the eval does not seem to support inner join. What should I do except modify JOIN_KEYWORDS = ('inner join', 'join', 'on', 'as')

Example SQL query:
SELECT dim_d_material.matl_desc AS 'xx', sum( dwh_f_sd_sales_order.net_value ) AS 'xxx', count( dwh_f_sd_sales_order.net_value ) AS 'xxx' FROM dim_d_material INNER JOIN dwh_f_sd_sales_order ON dim_d_material.dim_material_id = dwh_f_sd_sales_order.dim_material_id WHERE dwh_f_sd_sales_order.rec_create_date >= "2020-2-1" AND dwh_f_sd_sales_order.rec_create_date <= "2020-2-28" GROUP BY dim_d_material.matl_desc ORDER BY sum( dwh_f_sd_sales_order.net_value ) DESC LIMIT 10

error information:
Traceback (most recent call last):
File "/home/nlp2/Desktop/spider/test-suite-sql-eval/evaluation.py", line 938, in
evaluate(args.gold, args.pred, args.db, args.etype, kmaps, args.plug_value, args.keep_distinct, args.progress_bar_for_each_datapoint)
File "/home/nlp2/Desktop/spider/test-suite-sql-eval/evaluation.py", line 574, in evaluate
g_sql = get_sql(schema, g_str)
File "/home/nlp2/Desktop/spider/test-suite-sql-eval/process_sql.py", line 557, in get_sql
_, sql = parse_sql(toks, 0, tables_with_alias, schema)
File "/home/nlp2/Desktop/spider/test-suite-sql-eval/process_sql.py", line 509, in parse_sql
from_end_idx, table_units, conds, default_tables = parse_from(toks, start_idx, tables_with_alias, schema)
File "/home/nlp2/Desktop/spider/test-suite-sql-eval/process_sql.py", line 390, in parse_from
idx, table_unit, table_name = parse_table_unit(toks, idx, tables_with_alias, schema)
File "/home/nlp2/Desktop/spider/test-suite-sql-eval/process_sql.py", line 260, in parse_table_unit
key = tables_with_alias[toks[idx]]
KeyError: 'inner'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant