Skip to content
  • Home
  • Tech
    • Data Recovery
      • Electronics
      • PERSONAL TECH
      • Food Tech
  • INTERNET
  • SOCIAL MEDIA
    • ONLINE MARKETING
  • GAMING
    • Hardware
  • APPS
    • Mobile Computing
  • NETWORKING
    • Programming
  • Software
  • WEB HOSTING
    • COMPUTERS AND TECHNOLOGY
    • Data Base
    • COMPUTER FORENSICS
      • Technology
  • Contact Us
    • Write For Us

Calendar

March 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  
« Oct    

Archives

  • October 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • March 2024
  • August 2023
  • June 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • October 202

Categories

  • APPS
  • Business
  • COMPUTER FORENSICS
  • COMPUTERS AND TECHNOLOGY
  • crypto
  • Data Base
  • Data Recovery
  • Electronics
  • Food Tech
  • GAMING
  • Hardware
  • INTERNET
  • Jewellery
  • Mobile Computing
  • more
  • NETWORKING
  • ONLINE MARKETING
  • PERSONAL TECH
  • Programming
  • SOCIAL MEDIA
  • Software
  • Tech
  • Technology
  • Uncategorized
Tech Leak
  • Home
  • Tech
    • Data Recovery
      • Electronics
      • PERSONAL TECH
      • Food Tech
  • INTERNET
  • SOCIAL MEDIA
    • ONLINE MARKETING
  • GAMING
    • Hardware
  • APPS
    • Mobile Computing
  • NETWORKING
    • Programming
  • Software
  • WEB HOSTING
    • COMPUTERS AND TECHNOLOGY
    • Data Base
    • COMPUTER FORENSICS
      • Technology
  • Contact Us
    • Write For Us
Tech

How do I use BigQuery DML to transform some fields of a struct nested within an array, within a struct, within an array?

On December 11, 2021 by Anne Williams

I think this is a more complex version of the question in Update values in struct arrays in BigQuery.

I’m trying to update some of the fields in a struct, where the struct is heavily nested. I’m having trouble creating the SQL to do it. Here’s my table schema:

CREATE TABLE `my_dataset.test_data_for_so`
(
  date DATE,
  hits ARRAY<STRUCT<search STRUCT<query STRING, other_column STRING>, metadata ARRAY<STRUCT<key STRING, value STRING>>>>
);

This is what the schema looks like in the BigQuery GUI after I create the table:

BigQuery table schema from GUI

Here’s the data I’ve inserted:

INSERT INTO `my_dataset.test_data_for_so` (date, hits)
VALUES (
  CAST('2021-01-01' AS date),
  [
    STRUCT(
      STRUCT<query STRING, other_column STRING>('foo bar', 'foo bar'),
      [
        STRUCT<key STRING, value STRING>('foo bar', 'foo bar')
      ]
    )
  ]
)

My goal is to transform the “search.query” and “metadata.value” fields. For example, uppercasing them, leaving every other column (and every other struct field) in the row unchanged.

I’m looking for a solution involving either manually specifying each column in the SQL, or preferably, one where I can only mention the columns/fields I want to transform in the SQL, omitting all other columns/fields. This is a minimal example. The table I’m working on in production has hundreds of columns and fields.

For example, that row, when transformed this way, would change from:

[
  {
    "date": "2021-01-01",
    "hits": [
      {
        "search": {
          "query": "foo bar",
          "other_column": "foo bar"
        },
        "metadata": [
          {
            "key": "foo bar",
            "value": "foo bar"
          }
        ]
      }
    ]
  }
]

to:

[
  {
    "date": "2021-01-01",
    "hits": [
      {
        "search": {
          "query": "FOO BAR",
          "other_column": "foo bar"
        },
        "metadata": [
          {
            "key": "foo bar",
            "value": "FOO BAR"
          }
        ]
      }
    ]
  }
]
Tags: google-bigquery, sql

About Annie

Jessica Ramos: Running as the "Real Democrat" To Replace Peralta | Jackson Heights Post

The possibilities for taking advantage of the green energy revolution are varied, and you’ll be amazed how easy and cheap it is to go green.

Latest Posts

  • Invertir en Diamantes Rosados y Diamantes de LaboratorioInvertir en Diamantes Rosados y Diamantes de Laboratorio
  • The electricity of diamond 4cs and lab made diamonds: A complete manual for contemporary customersThe electricity of diamond 4cs and lab made diamonds: A complete manual for contemporary customers
  • Cushion Diamond vs Man Made Diamonds: A Clear Guide for Modern BuyersCushion Diamond vs Man Made Diamonds: A Clear Guide for Modern Buyers
  • Lab grown diamonds pendantsBuying Lab Grown Diamonds Pendants Without Confusion
  • diamond initialsDiamond Initials Are Becoming Australia’s Most Personal Jewellery Trend
  • engagement rings ParramattaEngagement Rings Parramatta and the Truth About Lab Diamonds
  • toi et moiToi et Moi: Why This Two-Stone Style Keeps Stealing Hearts
  • Generative AIWhat Is Generative AI? A Complete Beginner’s Guide
  • The Sparkling Future of Diamond Ring Malaysia and Man Made DiamondsThe Sparkling Future of Diamond Ring Malaysia and Man Made Diamonds
  • lab diamondsThe Timeless Allure of Round Engagement Rings in New Zealand
  • lab made diamonds vs realTruth Beneath the Sparkle: What I Learned About Lab Made Diamonds vs Real
  • lab grown diamondsWhy Lab Grown Diamond Initials Are the New Personal Statement in Jewellery
  • oval engagement rings AustraliaOval Engagement Rings in Australia (with Lab Made Diamonds) Are Taking Over
  • Top Product Engineering Trends to Watch in 2025 and BeyondTop Product Engineering Trends to Watch in 2025 and Beyond
  • lab grown diamondsGIA vs IGI: What You Need to Know About Lab Grown Diamonds

Recent Posts

  • Invertir en Diamantes Rosados y Diamantes de LaboratorioInvertir en Diamantes Rosados y Diamantes de Laboratorio
  • The electricity of diamond 4cs and lab made diamonds: A complete manual for contemporary customersThe electricity of diamond 4cs and lab made diamonds: A complete manual for contemporary customers
  • Cushion Diamond vs Man Made Diamonds: A Clear Guide for Modern BuyersCushion Diamond vs Man Made Diamonds: A Clear Guide for Modern Buyers
  • Lab grown diamonds pendantsBuying Lab Grown Diamonds Pendants Without Confusion
  • diamond initialsDiamond Initials Are Becoming Australia’s Most Personal Jewellery Trend
  • engagement rings ParramattaEngagement Rings Parramatta and the Truth About Lab Diamonds
  • toi et moiToi et Moi: Why This Two-Stone Style Keeps Stealing Hearts
  • Generative AIWhat Is Generative AI? A Complete Beginner’s Guide
  • The Sparkling Future of Diamond Ring Malaysia and Man Made DiamondsThe Sparkling Future of Diamond Ring Malaysia and Man Made Diamonds
  • lab diamondsThe Timeless Allure of Round Engagement Rings in New Zealand
  • lab made diamonds vs realTruth Beneath the Sparkle: What I Learned About Lab Made Diamonds vs Real
  • lab grown diamondsWhy Lab Grown Diamond Initials Are the New Personal Statement in Jewellery
  • oval engagement rings AustraliaOval Engagement Rings in Australia (with Lab Made Diamonds) Are Taking Over
  • Top Product Engineering Trends to Watch in 2025 and BeyondTop Product Engineering Trends to Watch in 2025 and Beyond
  • lab grown diamondsGIA vs IGI: What You Need to Know About Lab Grown Diamonds

More To View

  • Invertir en Diamantes Rosados y Diamantes de LaboratorioInvertir en Diamantes Rosados y Diamantes de Laboratorio
  • The electricity of diamond 4cs and lab made diamonds: A complete manual for contemporary customersThe electricity of diamond 4cs and lab made diamonds: A complete manual for contemporary customers
  • Cushion Diamond vs Man Made Diamonds: A Clear Guide for Modern BuyersCushion Diamond vs Man Made Diamonds: A Clear Guide for Modern Buyers
  • Lab grown diamonds pendantsBuying Lab Grown Diamonds Pendants Without Confusion
  • diamond initialsDiamond Initials Are Becoming Australia’s Most Personal Jewellery Trend
  • engagement rings ParramattaEngagement Rings Parramatta and the Truth About Lab Diamonds
  • toi et moiToi et Moi: Why This Two-Stone Style Keeps Stealing Hearts
  • Generative AIWhat Is Generative AI? A Complete Beginner’s Guide
  • The Sparkling Future of Diamond Ring Malaysia and Man Made DiamondsThe Sparkling Future of Diamond Ring Malaysia and Man Made Diamonds
  • lab diamondsThe Timeless Allure of Round Engagement Rings in New Zealand
  • lab made diamonds vs realTruth Beneath the Sparkle: What I Learned About Lab Made Diamonds vs Real
  • lab grown diamondsWhy Lab Grown Diamond Initials Are the New Personal Statement in Jewellery
  • oval engagement rings AustraliaOval Engagement Rings in Australia (with Lab Made Diamonds) Are Taking Over
  • Top Product Engineering Trends to Watch in 2025 and BeyondTop Product Engineering Trends to Watch in 2025 and Beyond
  • lab grown diamondsGIA vs IGI: What You Need to Know About Lab Grown Diamonds

Popular Posts

  • Invertir en Diamantes Rosados y Diamantes de LaboratorioInvertir en Diamantes Rosados y Diamantes de Laboratorio
  • The electricity of diamond 4cs and lab made diamonds: A complete manual for contemporary customersThe electricity of diamond 4cs and lab made diamonds: A complete manual for contemporary customers
  • Cushion Diamond vs Man Made Diamonds: A Clear Guide for Modern BuyersCushion Diamond vs Man Made Diamonds: A Clear Guide for Modern Buyers
  • Lab grown diamonds pendantsBuying Lab Grown Diamonds Pendants Without Confusion
  • diamond initialsDiamond Initials Are Becoming Australia’s Most Personal Jewellery Trend
  • engagement rings ParramattaEngagement Rings Parramatta and the Truth About Lab Diamonds
  • toi et moiToi et Moi: Why This Two-Stone Style Keeps Stealing Hearts
  • Generative AIWhat Is Generative AI? A Complete Beginner’s Guide
  • The Sparkling Future of Diamond Ring Malaysia and Man Made DiamondsThe Sparkling Future of Diamond Ring Malaysia and Man Made Diamonds
  • lab diamondsThe Timeless Allure of Round Engagement Rings in New Zealand

Latest Posts

  • Generative AIWhat Is Generative AI? A Complete Beginner’s Guide
  • Low-Code EnvironmentsThe Security Shield: Safeguarding Data and Applications in Low-Code Environments
  • The Importance Of Net Linking For SEOThe Importance Of Net Linking For SEO
  • 7 Ways To Watch Cyfrowy Polsat GO Abroad7 Ways To Watch Cyfrowy Polsat GO Abroad

Trending Posts

  • Invertir en Diamantes Rosados y Diamantes de LaboratorioInvertir en Diamantes Rosados y Diamantes de Laboratorio
  • The electricity of diamond 4cs and lab made diamonds: A complete manual for contemporary customersThe electricity of diamond 4cs and lab made diamonds: A complete manual for contemporary customers
  • Cushion Diamond vs Man Made Diamonds: A Clear Guide for Modern BuyersCushion Diamond vs Man Made Diamonds: A Clear Guide for Modern Buyers
  • Lab grown diamonds pendantsBuying Lab Grown Diamonds Pendants Without Confusion

Featured Posts

  • Top Product Engineering Trends to Watch in 2025 and BeyondTop Product Engineering Trends to Watch in 2025 and Beyond
  • Traveling Alone? Top 4 Gadgets You Must Take Along!Traveling Alone? Top 4 Gadgets You Must Take Along!
  • How to Read Another Number’s WhatsApp Messages?How to Read Another Number’s WhatsApp Messages?
  • Uploading From Onedrive Mobile App To SharepointUploading From Onedrive Mobile App To Sharepoint

Recent Posts

  • Become a Snapchat Pro with These Tips & TricksBecome a Snapchat Pro with These Tips & Tricks
  • How To Grow Your YouTube Channel with Free SubscribersHow To Grow Your YouTube Channel with Free Subscribers
  • 8 Ways To Gain Instagram Likes8 Ways To Gain Instagram Likes
  • Tips to Get More Engagement in Social Media VideosTips to Get More Engagement in Social Media Videos
© 2026 Tech Leak
Go to mobile version