awslabs / gap-text2sql

GAP-text2SQL: Learning Contextual Representations for Semantic Parsing with Generation-Augmented Pre-Training
https://arxiv.org/abs/2012.10309
Apache License 2.0
102 stars 25 forks source link

The JOIN table part of the output SQL does not contain ON clauses. #8

Open lanqil opened 3 years ago

lanqil commented 3 years ago

Hello, I found the output sql does not contain ON clauses. For example, "question": "Show the stadium name and the number of concerts in each stadium." "predicted": "SELECT stadium.Name, Count() FROM stadium JOIN concert GROUP BY stadium.Stadium_ID" "gold": "SELECT T2.name , count() FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id" I want to know how to get the on clauses "ON T1.stadium_id = T2.stadium_id". Thank you.

awasthiabhijeet commented 3 years ago

Hi @Impavidity @pnpnpn, I am also facing the same issue. Any suggestions to fix this problem?

xkluan commented 3 years ago

I'm also facing this issue now..... @Impavidity @pnpnpn Can you give us some help?

Impavidity commented 3 years ago

You can get the ON clause by rules based on the structure of the database. For example, the concert table has a foreign key that connect to the primary key of stadium table. Then you can compose concert.stadium_id = stadium.stadium_id.

surajjkumar commented 2 years ago

Hey @Impavidity , I am facing the same issue. How do I execute the solution you just suggested. Can you please elaborate a little.