Get TableSchema from BigQuery result PCollection

前端 未结 2 568
星月不相逢
星月不相逢 2020-12-21 09:16

When I run a query in BigQuery Web UI, the results are displayed in a table where both name and type of each field are known (even when a field is a result of COUNT(), AVG()

2条回答
  •  温柔的废话
    2020-12-21 10:13

    Conceptually - you should write the function which will iterate thru all cells of given TableRow and for each - get name and type and while iterating you will create respective TableSchema.
    For simple schemas, I would expect, it should be relatively easy.
    For schemas with records, repeated, etc. this could be more complex

提交回复
热议问题