question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[firestore-bigquery-export] not creating Ingestion-time partitioned table

See original GitHub issue

Describe your configuration

  • Extension name: firestore-bigquery-export
  • Extension version: 0.1.13
  • Configuration values:-
    • Cloud functions location: eu-west1
    • Big Query Dataset location: eu
    • Collection path: sales
    • Dataset ID: firestore-sales-stream
    • BigQuery SQL table partitioning option: DAY

Describe the problem

According to the documentation here I should be able to run the following query to get a list of partitions (admittedly I’ve only set this up today and back filled the table with the supplied script so I’d only expect to see 1 partition):-

SELECT _PARTITIONDATE as pt, FORMAT_TIMESTAMP("%Y%m%d", _PARTITIONDATE) as partition_date
FROM `****.firestore_sales_stream.sales_raw_changelog`
GROUP BY _PARTITIONDATE
ORDER BY _PARTITIONDATE

Steps to reproduce:

Install, configure and run the extension from within the Firebase Dashboard for my project.

Back fill the table with the script from the instructions specified here

Expected result

A (short) list of formatted partition dates based on the pseudo columns _PARTITIONTIME and _PARTITIONDATE

Actual result

The BiqQuery console reports the following error:-

Error running query
Unrecognized name: _PARTITIONDATE; Did you mean _PARTITION_DATE? 
Additional

I’m just trying to get my head around querying partitioned tables to improve performance and seem to be stumbling at the first hurdle.

I can confirm that all my data was successfully back filled and changes to documents in my collection are being streamed fine. Just curious as to why I don’t seem to have a partitioned table?

Thanks!

Ben

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
soarbcommented, Mar 22, 2021

That’s the problem really, I can’t list/find/query any columns like this from the table generated by the extension. Here’s what the schema looks like:-

image

All the expected fields are present apart from the pseudo columns for an ingestion-time partitioned table. As the docs state:-

When you create an ingestion-time partitioned table, two pseudo columns are added to the table: a _PARTITIONTIME pseudo column and a _PARTITIONDATE pseudo column

I was hoping to query for these columns to prove that the partitioning was working, then update our sales report query so that it only targeted a subset of the last 7 days rather than the entire table.

At the moment, the query takes a significant time to run and of course will continue to take longer and longer as new sales data is streamed.

1reaction
dackers86commented, Mar 23, 2021

Based on the config provided. I’ll add this to our tracker as a potential bug

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating partitioned tables | BigQuery - Google Cloud
You can use this approach to create a table that is partitioned by time-unit column or integer range, but not ingestion time. Use...
Read more >
Google Big Query splitting an ingestion time partitioned table
Case you describe required having two level partitioning which is not supported yet. You can create column partition table ...
Read more >
Historical load into Ingestion Time partitioned BigQuery table ...
Since the new schema was not compatible with old tables, we had to create new downstream tables with new schema. After implementing this...
Read more >
How can I create and use partitioned tables in Amazon Athena?
This means that there's no need to add partitions to the Data Catalog with partition projection. Because in-memory operations are usually faster ...
Read more >
Creating Date-Partitioned Tables in BigQuery
This lab focuses on how to query partitioned datasets and how to create your ... about how to create ingestion-time partitioned tables that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found