user_1357
user_1357

Reputation: 7940

Cannot read and write the query result back to BigQuery

I am using BigQueryIO.readTableRows().fromQuery(...) to read rows from BigQuery then writing TableRow back to BigQuery using BigQueryIO.writeTableRows(). I have table with correct schema already created so using CreateDisposition.CREATE_NEVER and will not have to set schema in Beam client. Problem is that the all Record fields are flattened(underscore appended) in query result and does not match the schema of the table which is not in flattened form. Using .withoutResultFlattening() on reads did not help unflattening the Records so cannot get around this discrepancy. How do we query without flattening the result?

Upvotes: 0

Views: 163

Answers (1)

enle lin
enle lin

Reputation: 1714

You can use Standard SQL since the results will not be flattened as explained here.

Upvotes: 1

Related Questions