Skip to content

Partition columns cannot be queried due to missing prefix #60

@lixiliu

Description

@lixiliu

Issue overview

Columns used to partition parquet tables through buildstockbatch's postprocessing partition_columns are left unformatted (i.e., without any prefixes). This makes the partitioned columns unqueriable for some functions, like agg.aggregate_annual because we only attempt to fetch them in a format inferred from db_schema.

For example, OEDI tables "resstock_2024_amy2018_release_2_metadata_state_vu" and "resstock_2024_amy2018_release_2_by_state_vu" are partitioned by state. The state column name in both tables is state instead of in.state. State is unfetchable for annual aggregation. HOWEVER, agg.aggregate_timeseries and other functions seem to take input column as is and does not appear to have this problem.

Current Behavior

Error received:

*** ValueError: Invalid column name in.state

Expected Behavior

Steps to Reproduce

  1. Run demo notebook: https://github.com/NREL/buildstock-query/blob/370f27ccf6ae35cbd8eea957fcb6332906e416de/example_usage/basic_usage_oedi.ipynb#L8
  2. Under Simple Annual Query, change group_by from ["geometry_building_type_recs"] to ["state"]

Possible Solution

Allow _get_column() of unformatted column

Details

Environment

Some additional details about your environment for this issue (if relevant):

  • Platform (Operating system, version):
  • Version of OpenStudio (if using an intermediate build, include SHA):

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions