<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Atsushi2022</author_name>
  <author_url>https://blog.hatena.ne.jp/Atsushi2022/</author_url>
  <blog_title>Atsushi2022の日記</blog_title>
  <blog_url>https://atsushi2022.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>先日、BigQueryのJSON型データを扱う際に、キーがバラバラで値の抽出処理ができなくて困った。 こちらの記事を参考にして、キーをダミーの文字列に置換して処理する方法でなんとか解決できた。 maxhalford.github.io 例えば下記のようなキーにユーザID、値にユーザ名が入っている場合、普通のやり方だとユーザIDを事前に知らないとユーザ名を抽出できない。 ここでユーザIDを一度「KEY」という文字列に置換してから、JSONのパスを「$.KEY」で指定することで、ユーザ名を取り出すことができる。 WITH sample AS ( SELECT JSON '{&quot;8901&quot;: &quot;山田 …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fatsushi2022.hatenablog.com%2Fentry%2F2025%2F05%2F05%2F213715&quot; title=&quot;【BigQuery】JSONテクニック。キーが動的な場合はダミーに置換 - Atsushi2022の日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-05-05 21:37:15</published>
  <title>【BigQuery】JSONテクニック。キーが動的な場合はダミーに置換</title>
  <type>rich</type>
  <url>https://atsushi2022.hatenablog.com/entry/2025/05/05/213715</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
