Cannot access field on a value with type ARRAY

Asked

Viewed 379 times

-1

I’m trying to pull the spine name.pt_BR that is inside the column namebut I still don’t understand how to get it specifically in Bigquery.

How to pull this info to give JOIN in another query later?

SELECT name.pt_BR FROM `source_internal.skills` 

Returns the error

Cannot access field pt_BR on a value with type ARRAY<STRUCT<pt_BR STRING, en STRING>> at [1:13]

inserir a descrição da imagem aqui

  • You don’t need to put "solved" in the title. I know it’s common in many forums, but here it works different. Just accept the answer that solved the problem, that is enough to indicate that it has been solved. Or, if it wasn’t the answer you solved, you can answer it yourself: just use the field below (the textarea "Your Answer"), and then mark it as accepted.

1 answer

0

You can try using the command UNNEST.

In your example I think it would look something like:

SELECT n.pt_BR FROM `source_internal.skills`, UNNEST(name) AS n

Browser other questions tagged

You are not signed in. Login or sign up in order to post.