Justas
Justas

Reputation: 1

Is it possible to reprocess existing table and how?

I have a few tables and would like to reprocess everything into one table. Is it possible?

I used "verbal" explanation of the situation, hope it is understandable.

i.e. I have table1 with column1 and column2.

Record1 contains column1_stringA and column2_stringB.
Record2 contains column1_stringC and column2_stringB. 

I want to put that record into table2 (column1, column2, column3) where column3 = if table1.column1.value = "column1_stringA" return column3_A, else return column3_C.

P.S.: I can't export as csv as it has nested elements.

Any ideas?

Upvotes: 0

Views: 65

Answers (2)

Javier Ramirez
Javier Ramirez

Reputation: 3988

You can do a select of your tables using JOIN and the IF operator to get exactly the results you would want inserted.

Then you can run the select adding your table2 as a destination, as explained in this post

That should do the trick

Upvotes: 2

jacek2v
jacek2v

Reputation: 590

I think you should write program using BigQuery.Table API - using get & insert functions (https://developers.google.com/bigquery/docs/reference/v2/tables) because: BigQuery tables are append-only (https://developers.google.com/bigquery/docs/tables#deletingrows)

Upvotes: 0

Related Questions