-1

I have an intermediate table that holds send_timestamp and JSON data in its columns. I'm using dataflow to insert data from pubsub to this intermediate table.

Now my use case is to authenticate the data and flatten the nested JSON in the intermediate table into the relevant columns in my final Bigquery table between a particular timestamp and insert it. I used cloud function but the total messages are huge so it is not working out.

Can someone please recommend a solution and that requires less amount of time to make it work?

Thanks!

Mohsin Mumtaz
  • 63
  • 1
  • 11

1 Answers1

2

Simply use DML. Perform a query like this

insert into DATASET.TARGET_TABLE
select * from DATASET.tmp_table where ....

Your cloud function can run this query and exit. Or wait the end to be sure that the job is over and successful.

EDIT

You can read (and only read) the data into Cloud SQL thanks to federated table.

Like this, you can perform your where close with the data into BigQuery and select only this one which match with the CloudSQL ones!

guillaume blaquiere
  • 66,369
  • 2
  • 47
  • 76