假设我有一个类似于 BigQuery 文档中提到的架构:
Last modified Schema Total Rows Total Bytes Expiration
----------------- ----------------------------------- ------------ ------------- ------------
27 Sep 10:01:06 |- kind: string 4 794
|- fullName: string (required)
|- age: integer
|- gender: string
+- phoneNumber: record
| |- areaCode: integer
| |- number: integer
+- children: record (repeated)
| |- name: string
| |- gender: string
| |- age: integer
+- citiesLived: record (repeated)
| |- place: string
| +- yearsLived: integer (repeated)
假设我们有 fullNames : John, josh, harry
居住城市:纽约、芝加哥、西雅图
如何通过使用条件来遍历 cityLived 和计数。例如,我想计算有多少 fullName = John 的用户同时住在 cityLived.place = newyork 和 cityLived.place = Chicago,但没有住在 cityLived.place = seattle。
谢谢,约翰