0

I have some tables on BigQuery that the schema looks like below.

enter image description here

enter image description here When I execute the below query I got some exceptions

select * from `test.test.test_partitioned` WHERE DATE(_PARTITIONTIME) = "2020-03-01"  and account.final_balance_sum >1

Cannot access field final_balance_sum on a value with type ARRAY<STRUCT<account_name STRING, final_balance_sum FLOAT64>> at [16:141]

enter image description here

I have tried the solution from here, seems it doesn't work to me at all.

Cannot access field in Big Query with type ARRAY<STRUCT<hitNumber INT64, time INT64, hour INT64, ...>>

SharpLu
  • 1,136
  • 2
  • 12
  • 28

1 Answers1

2
select * EXCEPT(acc)
from `test.test.test_partitioned`,
UNNEST(account) acc
WHERE DATE(_PARTITIONTIME) = "2020-03-01"  
and acc.final_balance_sum >1
Mikhail Berlyant
  • 165,386
  • 8
  • 154
  • 230