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

Support Aliases without 'AS' #17

Open
niryarden opened this issue Sep 27, 2023 · 0 comments
Open

Support Aliases without 'AS' #17

niryarden opened this issue Sep 27, 2023 · 0 comments

Comments

@niryarden
Copy link

niryarden commented Sep 27, 2023

As can be seen in this link, both cases:

SELECT * FROM Table AS t
SELECT * FROM Table t

are valid in many SQL versions, yet the second query isn't supported, as can be seen in the code, in the file process_sql.py:

def scan_alias(toks):
    """Scan the index of 'as' and build the map for all alias"""
    as_idxs = [idx for idx, tok in enumerate(toks) if tok == 'as']
    alias = {}
    for idx in as_idxs:
        alias[toks[idx+1]] = toks[idx-1]
    return alias
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