Skip to content

Support Aliases without 'AS' #17

@niryarden

Description

@niryarden

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

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