1
votes

I have some objects with nested fields that I want to write from my dataflow job into a BigQuery table. I understand how to create the table schema, but I don't see how to create a TableRow with nested fields.

The TableRow object is just a list of TableCell objects, which appear to be String,Object key-value pairs. How can I build a nested object this way? Can the value of a TableCell be a TableRow?

1
Welcome to SO. Please show a concrete example of what you have tried so far. - T-Heron
@ElliottBrossard thanks, that does help, if only by implication. - Peter C.

1 Answers

3
votes

The link shared by @ElliotBrossard points towards a solution: https://sookocheff.com/post/bigquery/writing-repeated-bigquery-records/

Just as a repeated field is represented using a List<TableRow>, a nested field is represented using a TableRow where some of the field values are themselves TableRow objects.