{"id":3198,"date":"2023-02-10T09:36:32","date_gmt":"2023-02-10T00:36:32","guid":{"rendered":"https:\/\/blog.since2020.jp\/?p=3198"},"modified":"2023-02-15T09:39:39","modified_gmt":"2023-02-15T00:39:39","slug":"bigquery_table_schema","status":"publish","type":"post","link":"https:\/\/since2020.jp\/media\/bigquery_table_schema\/","title":{"rendered":"BigQuery\u306e\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30fc\u30de\u3092JSON\u5f62\u5f0f\u3067\u53d6\u5f97\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"\n<p>BigQuery\u306f\u3001Google Cloud Platform (GCP) \u304c\u63d0\u4f9b\u3059\u308b\u5f37\u529b\u3067\u9ad8\u901f\u306a\u30c7\u30fc\u30bf \u30a6\u30a7\u30a2\u30cf\u30a6\u30b8\u30f3\u30b0 \u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002BigQuery\u306e\u4e3b\u306a\u6a5f\u80fd\u306e 1 \u3064\u306b\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5185\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u69cb\u9020\u3068\u30c7\u30fc\u30bf\u578b\u3092\u5b9a\u7fa9\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30fc\u30de\u3092\u7ba1\u7406\u304a\u3088\u3073\u53d6\u5f97\u3059\u308b\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\u3002\u4eca\u56de\u306f\u3001GCP \u306e Cloud Shell \u3092\u4f7f\u7528\u3057\u3066BigQuery\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u3092 JSON \u5f62\u5f0f\u3067\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n<h2>Cloud Shell\u306e\u8d77\u52d5<\/h2>\n<p><img decoding=\"async\" width=\"960\" height=\"540\" src=\"\/wp-content\/uploads\/2023\/02\/cclooudshell_demo.png\" alt=\"\" class=\"wp-image-3200\" srcset=\"https:\/\/since2020.jp\/media\/wp-content\/uploads\/2023\/02\/cclooudshell_demo.png 960w, https:\/\/since2020.jp\/media\/wp-content\/uploads\/2023\/02\/cclooudshell_demo-300x169.png 300w, https:\/\/since2020.jp\/media\/wp-content\/uploads\/2023\/02\/cclooudshell_demo-768x432.png 768w\" sizes=\"(max-width: 960px) 100vw, 960px\" \/><\/p>\n<p>GCP\u30a2\u30ab\u30a6\u30f3\u30c8\u306eCloud Console\u306b\u79fb\u52d5\u3057\u3066\u3001Cloud Shell\u3092\u958b\u304d\u307e\u3059\u3002<\/p>\n\n<h2>\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30fc\u30de\u3092JSON\u5f62\u5f0f\u3067\u53d6\u5f97<\/h2>\n<p>\u307e\u305a\u3001Cloud Shell\u3067\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u4f7f\u7528\u53ef\u80fd\u306a\u30c6\u30fc\u30d6\u30eb\u3092\u4e00\u89a7\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p><strong>bq ls<\/strong><\/p>\n<p>\u6b21\u306b\u3001\u30b9\u30ad\u30fc\u30de\u3092\u53d6\u5f97\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u3092\u898b\u3064\u3051\u3066\u3001\u30c6\u30fc\u30d6\u30eb ID \u3092\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002\u6700\u5f8c\u306b\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u6307\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u3092JSON\u5f62\u5f0f\u3067\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002[TABLE_ID]\u306f\u5b9f\u969b\u306e\u30c6\u30fc\u30d6\u30eb ID\u306b\u7f6e\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>bq show &#8211;format=prettyjson [TABLE_ID]<\/strong><\/p>\n\n<h2>\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30fc\u30de\u3092json\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u51fa\u3057\u3001\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u306b\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/h2>\n<p>\u5148\u307b\u3069\u306e\u30b3\u30de\u30f3\u30c9\u3060\u3068\u3001Cloud Shell\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u306b\u30b9\u30ad\u30fc\u30de\u304cJSON\u5f62\u5f0f\u3067\u8868\u793a\u3055\u308c\u308b\u3060\u3051\u3067\u4f7f\u3044\u52dd\u624b\u304c\u3068\u3066\u3082\u60aa\u3044\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u53d6\u5f97\u3057\u305f\u30b9\u30ad\u30fc\u30de\u3092json\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u51fa\u3057\u3001\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u306b\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u6307\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u3092json\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u51fa\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p><strong>bq show &#8211;format=prettyjson [TABLE_ID] &gt; schema.json<\/strong><\/p>\n<p>\u66f8\u304d\u51fa\u3057\u305fjson\u30d5\u30a1\u30a4\u30eb\u3092\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u306b\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u305f\u3081\u306b\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>cloudshell download schema.json<\/strong><\/p>\n\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>\u4eca\u56de\u306fGCP \u306e Cloud Shell \u3092\u4f7f\u7528\u3057\u3066\u3001BigQuery\u306e\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30fc\u30de\u3092 JSON\u5f62\u5f0f\u3067\u53d6\u5f97\u3057\u307e\u3057\u305f\u3002\u7686\u3055\u3093\u3082\u662f\u975e\u6d3b\u7528\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044<\/p>","protected":false},"excerpt":{"rendered":"<p>BigQuery\u306f\u3001Google Cloud Platform (GCP) \u304c\u63d0\u4f9b\u3059\u308b\u5f37\u529b\u3067\u9ad8\u901f\u306a\u30c7\u30fc\u30bf \u30a6\u30a7\u30a2\u30cf\u30a6\u30b8\u30f3\u30b0 \u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002BigQuery\u306e\u4e3b\u306a\u6a5f\u80fd\u306e 1 \u3064\u306b\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5185\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u69cb\u9020\u3068\u30c7\u30fc [&hellip;]<\/p>\n","protected":false},"author":85,"featured_media":3199,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","swell_btn_cv_data":"","footnotes":"","_wp_rev_ctl_limit":""},"categories":[1246],"tags":[108,330,143,415,414],"class_list":["post-3198","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-infrastructure","tag-bigquery","tag-cloud-shell","tag-gcp","tag-json","tag-414"],"_links":{"self":[{"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/posts\/3198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/users\/85"}],"replies":[{"embeddable":true,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/comments?post=3198"}],"version-history":[{"count":0,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/posts\/3198\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/media\/3199"}],"wp:attachment":[{"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/media?parent=3198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/categories?post=3198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/tags?post=3198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}