Reputation: 1457
How do I get the position for a field nested in multiple level of records:
select position(repeatedRec.rec1.field)
where repeatedRec is a repeated record, and rec1 is a non-repeated record? Assume that repeatedRec doesn't have any other leaves. I need to know what is repeatedRec position for the element in which rec1.field resides.
This doesn't seem to work, and all I get is 1 (as if the system is treating the field as a non repeated field).
Upvotes: 2
Views: 597
Reputation: 1633
have you tried
select position(repeatedRec.rec1.field) WHITHIN repeatedRec.rec1 as f1
https://developers.google.com/bigquery/docs/data#within see this link for a small documentation on within
Upvotes: 0