Unnesting RECORD arrays in BigQuery SQL

Поділитися
Вставка
  • Опубліковано 14 лис 2024

КОМЕНТАРІ • 17

  • @gerritrindermann632
    @gerritrindermann632 4 роки тому +8

    I think conceptually you misunderstood something. It's not that you can't reference 3 levels deep. It's about unnesting is for arrays. What you did @4:54 with referencing into the second level is because that's actually a struct.
    You can see that in the schema. REPEATED means Array, RECORD means struct.
    In general what happens though that you have an array of structs. I think that's why you came up with the idea that the 3rd level needs to be unnested.
    I'm just leaning big query as well. So correct me if I'm wrong :)

    • @cacheworthy
      @cacheworthy  4 роки тому +2

      You may be right! I just do what gets the job done :)

    • @datacleaningchallenge2029
      @datacleaningchallenge2029 2 роки тому

      Can iHave your email? wanna ask a question if you don't mind

  • @iamfavoured9142
    @iamfavoured9142 Рік тому +1

    Thank you for This series
    God bless you

  • @judetoussaint3900
    @judetoussaint3900 4 роки тому +3

    I have a question. Why didn't you unnest Totals. It's also a record. Why unnest only hits. What's the difference?

  • @arzoo7380
    @arzoo7380 4 роки тому +2

    Hey can you write unnest query that will flatten nested array or array inside array as well.

  • @ayisha924
    @ayisha924 4 роки тому

    Awesome video! Thanks for the good work!

  • @thiagogramulha
    @thiagogramulha 4 роки тому +1

    What's the difference between CROSS JOIN and ","? It'll get different results? Or it is just another way to do the same thing?

    • @cacheworthy
      @cacheworthy  4 роки тому

      Hmm not sure I follow Thiago, can you drop an example here?

  • @andrewknight1751
    @andrewknight1751 2 роки тому

    I want to hug you. Thank you.

  • @andreasbeschorner1215
    @andreasbeschorner1215 2 роки тому

    No need to perform a join on nested data, you can just select from unnest.

  • @jurges8544
    @jurges8544 4 роки тому

    Hello
    Thank you for the course, i wanted to unnest traffic but the error message said it need to be a string. I wanted to know the difference between hits and traffic is because hits is repeated not nullable?

    • @cacheworthy
      @cacheworthy  4 роки тому

      Hey Jurge, sorry I'm not 100% sure what you're referring to there, could you ask that another way?

  • @rahulkhare3040
    @rahulkhare3040 4 роки тому

    how to handle this error. new to bigquery. please help.
    error : Column name name is ambiguous at [2:1]