Google BigQuery: Error "Cannot output multiple independently repeated fields at the same time" with Nested Queries

When you run a query against a table that has multiple repeated fields, you get the error something like below.

Error : Cannot output multiple independently repeated fields at the same time. Found column_a and column_b

If this is the case, you might want to

Flatten one of the fields.

For example,

SELECT
  fullName,
  age,
  gender,
  citiesLived.place
FROM (FLATTEN([dataset.tableId], children))
WHERE
  (citiesLived.yearsLived > 1995) AND
  (children.age > 3)
GROUP BY fullName, age, gender, citiesLived.place

Quoted from: https://cloud.google.com/bigquery/docs/legacy-nested-repeated#nested

Select fewer fields

You might want to select fewer fields. If you only care about getting flattened output of a few fields, you can remove the independently repeated fields from your query results by explicitly selecting only the fields you care about.

Quoted from: https://stackoverflow.com/questions/25583878/flattening-google-analytics-data-with-repeated-fields-not-working-anymore