Skip to content

Change the join to LEFT JOIN #470

@mgdenno

Description

@mgdenno

This join includes unmatched rows. This is a feature that has been requested. I don't know the ramifications of doing this, so it needs testing. At a minimum we would need to filter and null value rows before calculating metrics i suspect.

joined_df = ev.sql("""
            SELECT
                sf.reference_time
                , sf.value_time as value_time
                --, pf.location_id as primary_location_id
                , cf.primary_location_id as primary_location_id
                , sf.location_id as secondary_location_id
                , pf.value as primary_value
                , sf.value as secondary_value
                , sf.configuration_name
                , sf.unit_name
                , sf.variable_name
                , sf.member
            FROM secondary_timeseries sf
            JOIN location_crosswalks cf
                on cf.secondary_location_id = sf.location_id
            LEFT JOIN primary_timeseries pf
                on cf.primary_location_id = pf.location_id
                and sf.value_time = pf.value_time
                and sf.unit_name = pf.unit_name
                and sf.variable_name = pf.variable_name
        """)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationmainThis is an issue that is considered v0.5.0 maintenance and should be merged into mainv0.6-devDenotes that the issue is meant to be merged into the v0.6-beta development branch.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions