11{
2- "cells" : [
3- {
4- "cell_type" : " code" ,
5- "source" : [
6- " # sql_engine: bigquery\n " ,
7- " # output_variable: df\n " ,
8- " # start _sql\n " ,
9- " _sql = \"\"\"\n " ,
10- " ## [Restore deleted dataset](https://docs.cloud.google.com/bigquery/docs/restore-deleted-datasets#restore_a_dataset)\n " ,
11- " UNDROP SCHEMA httparchive.crawl;\n " ,
12- " \"\"\" # end _sql\n " ,
13- " from google.colab.sql import bigquery as _bqsqlcell\n " ,
14- " df = _bqsqlcell.run(_sql)\n " ,
15- " df"
16- ],
17- "metadata" : {
18- "colab_type" : " sql" ,
19- "id" : " XKFLLrG_ZlzC"
20- },
21- "id" : " XKFLLrG_ZlzC" ,
22- "execution_count" : null ,
23- "outputs" : []
24- },
25- {
26- "cell_type" : " code" ,
27- "execution_count" : null ,
28- "id" : " fe7ae694" ,
29- "metadata" : {
30- "id" : " fe7ae694"
31- },
32- "outputs" : [],
33- "source" : [
34- " ## [Restore deleted table](https://docs.cloud.google.com/bigquery/docs/restore-deleted-tables#restore_a_table)\n " ,
35- " !date -d '2025-08-04 16:00:00.000000Z' +%s000\n " ,
36- " !bq cp httparchive.crawl.pages@1759670400000 httparchive.crawl_staging.pages_backup_20250804"
37- ]
38- },
39- {
40- "cell_type" : " code" ,
41- "source" : [
42- " # sql_engine: bigquery\n " ,
43- " # output_variable: df\n " ,
44- " # start _sql\n " ,
45- " _sql = \"\"\"\n " ,
46- " ## [Restore a table to a specific point in time](https://cloud.google.com/bigquery/docs/restore-tables#restoring_a_table_to_a_specific_point_in_time)\n " ,
47- " SELECT *\n " ,
48- " FROM httparchive.crawl.pages\n " ,
49- " FOR SYSTEM_TIME AS OF TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 HOUR);\n " ,
50- " \"\"\" # end _sql\n " ,
51- " from google.colab.sql import bigquery as _bqsqlcell\n " ,
52- " df = _bqsqlcell.run(_sql)\n " ,
53- " df"
54- ],
55- "metadata" : {
56- "colab_type" : " sql" ,
57- "id" : " o4REpWzuZr03"
58- },
59- "id" : " o4REpWzuZr03" ,
60- "execution_count" : null ,
61- "outputs" : []
62- }
63- ],
64- "metadata" : {
65- "kernelspec" : {
66- "display_name" : " Python 3" ,
67- "language" : " python" ,
68- "name" : " python3"
69- },
70- "language_info" : {
71- "name" : " python" ,
72- "version" : " 3.12.8"
73- },
74- "colab" : {
75- "provenance" : []
76- }
2+ "cells" : [
3+ {
4+ "cell_type" : " code" ,
5+ "execution_count" : null ,
6+ "id" : " XKFLLrG_ZlzC" ,
7+ "metadata" : {
8+ "colab_type" : " sql" ,
9+ "id" : " XKFLLrG_ZlzC"
10+ },
11+ "outputs" : [],
12+ "source" : [
13+ " # sql_engine: bigquery\n " ,
14+ " # output_variable: df\n " ,
15+ " # start _sql\n " ,
16+ " _sql = \"\"\"\n " ,
17+ " ## [Restore deleted dataset](https://docs.cloud.google.com/bigquery/docs/restore-deleted-datasets#restore_a_dataset)\n " ,
18+ " UNDROP SCHEMA httparchive.crawl;\n " ,
19+ " \"\"\" # end _sql\n " ,
20+ " from google.colab.sql import bigquery as _bqsqlcell\n " ,
21+ " df = _bqsqlcell.run(_sql)\n " ,
22+ " df"
23+ ]
7724 },
78- "nbformat" : 4 ,
79- "nbformat_minor" : 5
80- }
25+ {
26+ "cell_type" : " code" ,
27+ "execution_count" : null ,
28+ "id" : " fe7ae694" ,
29+ "metadata" : {
30+ "id" : " fe7ae694"
31+ },
32+ "outputs" : [],
33+ "source" : [
34+ " ## [Restore deleted table](https://docs.cloud.google.com/bigquery/docs/restore-deleted-tables#restore_a_table)\n " ,
35+ " !date -d '2025-08-04 16:00:00.000000Z' +%s000\n " ,
36+ " !bq cp httparchive.crawl.pages@1759670400000 httparchive.crawl_staging.pages_restored_20250804"
37+ ]
38+ },
39+ {
40+ "cell_type" : " code" ,
41+ "execution_count" : null ,
42+ "id" : " o4REpWzuZr03" ,
43+ "metadata" : {
44+ "colab_type" : " sql" ,
45+ "id" : " o4REpWzuZr03"
46+ },
47+ "outputs" : [],
48+ "source" : [
49+ " # sql_engine: bigquery\n " ,
50+ " # output_variable: df\n " ,
51+ " # start _sql\n " ,
52+ " _sql = \"\"\"\n " ,
53+ " ## [Restore a table to a specific point in time](https://cloud.google.com/bigquery/docs/restore-tables#restoring_a_table_to_a_specific_point_in_time)\n " ,
54+ " CREATE TABLE httparchive.crawl_staging.pages_restored_20250804 AS\n " ,
55+ " SELECT *\n " ,
56+ " FROM httparchive.crawl.pages\n " ,
57+ " FOR SYSTEM_TIME AS OF TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 HOUR);\n " ,
58+ " \"\"\" # end _sql\n " ,
59+ " from google.colab.sql import bigquery as _bqsqlcell\n " ,
60+ " df = _bqsqlcell.run(_sql)\n " ,
61+ " df"
62+ ]
63+ }
64+ ],
65+ "metadata" : {
66+ "colab" : {
67+ "provenance" : []
68+ },
69+ "kernelspec" : {
70+ "display_name" : " Python 3" ,
71+ "language" : " python" ,
72+ "name" : " python3"
73+ },
74+ "language_info" : {
75+ "name" : " python" ,
76+ "version" : " 3.12.8"
77+ }
78+ },
79+ "nbformat" : 4 ,
80+ "nbformat_minor" : 5
81+ }
0 commit comments