1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] BigQuery SQL to add metadata to a column

Discussão em 'Outras Linguagens' iniciado por Stack, Setembro 24, 2021.

  1. Stack

    Stack Membro Participativo

    Currently, I have a BigQuery table with the following schema:

    region node_ids
    1 [1, 2, 3, 4]
    2 [5, 6, 7, 8]

    Where node_ids is a column of array<int64> in BigQuery.

    I have another table which contains a mapping from each node_id to the number of errors in that node and it looks something like this.

    node_id errors
    1 2
    2 3
    3 7
    4 5
    5 6
    6 9
    7 10
    8 6

    I want to use this secondary table to augment the first table with error values. Specifically, I'd like to turn node_ids into an array<struct<int64, int64>> where each node_id also has with it the number of errors.

    I'm not sure how to do this in BigQuery SQL. Thank you very much for your help in advance.

    Continue reading...

Compartilhe esta Página