Skip to content

🐛 [fs-bq-schema-views] Excessive first_value() over (partition by) clauses causes BQ resource exhaustion #2557

@jhanners

Description

@jhanners

[READ] Step 1: Are you in the right place?

Yes

[REQUIRED] Step 2: Describe your configuration

  • Extension name: fs-bq-schema-views
  • Extension version: 0.4.12
  • Configuration values (redact info where appropriate):
npx @firebaseextensions/fs-bq-schema-views \
  --schema-files=${schemaFile} \
  --non-interactive \
  --project=${gcpEnv} \
  --big-query-project=${gcpEnv} \
  --dataset=firestore_export \
  --table-name-prefix=${table}

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

  • Spin up a changelog table with 11M+ rows.
  • Create a schema view with 200+ columns.
  • Try to count the rows in the raw latest view:
select count(*) from `{model name}_raw_latest`
Expected result

We can count the rows in the view.

Actual result

BQ error:

Resources exceeded during query execution: The query could not be executed in the allotted memory. Peak usage: 123% of limit. Top memory consumer(s): sort operations used for analytic OVER() clauses: 99% other/unattributed: 1%

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions