Code Review
This pull request updates the @firebaseextensions/fs-bq-schema-views package to version 0.4.13 and optimizes the BigQuery view generation by replacing multiple FIRST_VALUE window functions with a single QUALIFY clause to improve performance on wide schemas. However, the use of ROW_NUMBER() in the QUALIFY clause introduces a bug where array data is lost during UNNEST operations; it is recommended to use RANK() instead to ensure all rows for the latest document version are preserved.
Originally posted by @gemini-code-assist[bot] in firebase/extensions#2759 (review)
Code Review
This pull request updates the
@firebaseextensions/fs-bq-schema-viewspackage to version 0.4.13 and optimizes the BigQuery view generation by replacing multipleFIRST_VALUEwindow functions with a singleQUALIFYclause to improve performance on wide schemas. However, the use ofROW_NUMBER()in theQUALIFYclause introduces a bug where array data is lost duringUNNESToperations; it is recommended to useRANK()instead to ensure all rows for the latest document version are preserved.Originally posted by @gemini-code-assist[bot] in firebase/extensions#2759 (review)