firebase / extensions

Source code for official Firebase extensions
https://firebase.google.com/products/extensions
Apache License 2.0
882 stars 374 forks source link

πŸ› [Stream Firestore to BigQuery] fs-bq-import-collection doesn't recognize partitioned field #2092

Open ysak-y opened 1 month ago

ysak-y commented 1 month ago

[REQUIRED] Step 2: Describe your configuration

[REQUIRED] Step 3: Describe the problem

When I install extension with following configuration, it creates BigQuery table with createdAt partitioned field.

γ‚Ήγ‚―γƒͺγƒΌγƒ³γ‚·γƒ§γƒƒγƒˆ 2024-05-13 10 53 55

The important thing is its extension project id and BigQuery id is different (Cross-Platform BigQuery).

But When I run fs-bq-import-collection to backfill, it doesn't recognize any partitioned fields. The script shows following debug message.

{"severity":"WARNING","message":"Did not add partitioning to schema: Partitioning not enabled"}

Steps to reproduce:

Create Firestore table with createdAt TIMESTAMP field and Install extension with above configuration.

Expected result

fs-bq-import-collection recognize createdAt partition field and set it when importing.

Actual result

fs-bq-import-collection doesn't recognize createdAt partition field and set null to createAt field when importing.

pr-Mais commented 1 month ago

From the POSTINSATALL:

Note: To enable partitioning for a Big Query database, the following fields are required:

 - Time Partitioning option type
 - Time partitioning column name
 - Time partiitioning table schema
 - Firestore document field name

`Clustering` will not need to create or modify a table when adding clustering options, this will be updated automatically.

You're expecting the table to be created with partitioning on createdAt, however the configuration doesn't specify that as a Time partitioning column name, the one you have is timestamp.