Skip to content

Parser.tables returns wrong values when join condition includes COALESCE #559

@roman-y

Description

@roman-y

using tables: List[str] = Parser(sql_file_content).tables
where part of sql_file_content is
INNER JOIN my_db_name.ipps_wage_index_annual WI ON OPR.year = WI.cms_year
INNER JOIN my_db_name.geo_county_cbsa CBS ON WI.cbsa_cd = COALESCE(CBS.metropolitan_division_code, CBS.cbsa_code, SUBSTRING(CBS.ssa_codes, 1, 2))
INNER JOIN ...

returns
CBS.cbsa_code
CBS.ssa_codes
as tables

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