BigQuery flattens when using field with same name as repeated field

前端 未结 3 625
Happy的楠姐
Happy的楠姐 2021-01-26 22:10

Edited to use public dataset

I have a table with the following schema, which you can access here: https://bigquery.cloud.google.com/table/reals

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-26 22:57

    If a query can be interpreted in many ways, BigQuery will do its best effort to guess what were your intentions - producing sometimes non-congruent results. This is true to every database, since SQL has space for these ambiguities.

    Solution: Eliminate ambiguity from your queries - probably both results are correct, depending on what you are trying to count.

    (eliminate ambiguity by not using *, and making the prefix explicit, while you could also make a explicit request on which ways you want the table flattened)

    I would really like to comment on your specific data and results, but given that you haven't provided a public sample, I can't.

提交回复
热议问题