Skip to content

Support Projection Aliases #18

Description

@niryarden

Problem:

Adding an alias to a projection in the SELECT clause is a pretty standard syntax:

SELECT count(*) AS table_size FROM Table

However, the evaluator breaks when trying to parse this kind of query.

Reproduce:

I went to the gold.txt file and changed the 3rd row from

SELECT Country FROM AIRLINES WHERE Airline  =  "JetBlue Airways"	flight_2

to

SELECT Country AS my_c FROM AIRLINES WHERE Airline  =  "JetBlue Airways"	flight_2`

When running

python evaluation.py --gold evaluation_examples/gold.txt --pred evaluation_examples/predict.txt --db database --etype match --plug_value --table tables.json

parse_sql crashed with:

AssertionError: Error col: as

thrown from parse_col when searching for the the not existing 'as' column in the schema.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions