Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sql_metadata/keywords_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"INTO": "insert",
"SET": "update",
"GROUPBY": "group_by",
"INNERJOIN": "inner_join",
}


Expand Down
13 changes: 13 additions & 0 deletions test/test_getting_columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,3 +528,16 @@ def test_nested_queries():
parser = Parser(query)
assert parser.columns == ["dt"]
assert parser.columns_dict == {"select": ["dt"]}


def test_double_inner_join():
query = """
SELECT loan.loan_id, district.a3 AS district, district.a11 AS average_salary
FROM loan
INNER JOIN account ON loan.account_id = account.account_id
INNER JOIN district ON account.district_id = district.district_id WHERE loan.duration = 60
"""

parser = Parser(query)
assert "loan.account_id" in parser.columns
assert parser.tables == ["loan", "account"]