firebase / extensions

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

🐛 [firestore-bigquery-export] Table not partitioned despite using default _PARTITIONTIME pseudo column #2196

Open ytetsuro opened 1 month ago

ytetsuro commented 1 month ago

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

Issues filed here should be about bugs for a specific extension in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

[REQUIRED] Step 2: Describe your configuration

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

install the firestore extension with the above settings. Maybe the following code is the problem.

https://github.com/firebase/extensions/blob/next/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/partitioning.ts#L97

Expected result

An unpartitioned table is generated.

Actual result

A table with _PARTITIONTIME pseudo column is generated.

Because the BigQuery Time Partitioning column name has the following description

BigQuery table column/schema field name for TimePartitioning. You can choose schema available as timestamp OR a new custom defined column that will be assigned to the selected Firestore Document field below. Defaults to pseudo column _PARTITIONTIME if unspecified. Cannot be changed if Table is already partitioned.
dan-massey commented 3 weeks ago

I'm also seeing issues with partitioning not working.

If I install a new instance of the extension with the configuration:

I get a table generated that is partitioned by _PARTITIONTIME, but the value of _PARTITIONTIME is always NULL.

If I install I update the instance to create a new dataset with the configuration:

A new table is created, but it isn't partitioned. The column partition_column is not created.

The documentation on configuring clustering through the extension is pretty confusing and would probably benefit from another revision.