You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: branches/spanner-gapic-migration/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/BigQuerySnippets.java
+30-30Lines changed: 30 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -170,14 +170,14 @@ public Page<Dataset> listDatasets(String projectId) {
Copy file name to clipboardExpand all lines: branches/spanner-gapic-migration/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/DatasetSnippets.java
+17-17Lines changed: 17 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -43,20 +43,20 @@ public class DatasetSnippets {
43
43
publicDatasetSnippets(Datasetdataset) {
44
44
this.dataset = dataset;
45
45
}
46
-
46
+
47
47
/**
48
48
* Example of checking whether a dataset exists.
49
49
*/
50
50
// [TARGET exists()]
51
51
publicbooleandoesDatasetExist() {
52
-
// [START bigquery_java_untracked]
52
+
// [START ]
53
53
booleanexists = dataset.exists();
54
54
if (exists) {
55
55
// the dataset exists
56
56
} else {
57
57
// the dataset was not found
58
58
}
59
-
// [END bigquery_java_untracked]
59
+
// [END ]
60
60
returnexists;
61
61
}
62
62
@@ -65,12 +65,12 @@ public boolean doesDatasetExist() {
65
65
*/
66
66
// [TARGET reload(DatasetOption...)]
67
67
publicDatasetreloadDataset() {
68
-
// [START bigquery_java_untracked]
68
+
// [START ]
69
69
DatasetlatestDataset = dataset.reload();
70
70
if (latestDataset == null) {
71
71
// The dataset was not found
72
72
}
73
-
// [END bigquery_java_untracked]
73
+
// [END ]
74
74
returnlatestDataset;
75
75
}
76
76
@@ -80,11 +80,11 @@ public Dataset reloadDataset() {
80
80
// [TARGET update(DatasetOption...)]
81
81
// [VARIABLE "my_friendly_name"]
82
82
publicDatasetupdateDataset(StringfriendlyName) {
83
-
// [START bigquery_java_untracked]
83
+
// [START ]
84
84
Builderbuilder = dataset.toBuilder();
85
85
builder.setFriendlyName(friendlyName);
86
86
DatasetupdatedDataset = builder.build().update();
87
-
// [END bigquery_java_untracked]
87
+
// [END ]
88
88
returnupdatedDataset;
89
89
}
90
90
@@ -93,14 +93,14 @@ public Dataset updateDataset(String friendlyName) {
93
93
*/
94
94
// [TARGET delete(DatasetDeleteOption...)]
95
95
publicbooleandeleteDataset() {
96
-
// [START bigquery_java_untracked]
96
+
// [START ]
97
97
booleandeleted = dataset.delete();
98
98
if (deleted) {
99
99
// The dataset was deleted
100
100
} else {
101
101
// The dataset was not found
102
102
}
103
-
// [END bigquery_java_untracked]
103
+
// [END ]
104
104
returndeleted;
105
105
}
106
106
@@ -109,42 +109,42 @@ public boolean deleteDataset() {
109
109
*/
110
110
// [TARGET list(TableListOption...)]
111
111
publicPage<Table> list() {
112
-
// [START bigquery_java_untracked]
112
+
// [START ]
113
113
Page<Table> tables = dataset.list();
114
114
for (Tabletable : tables.iterateAll()) {
115
115
// do something with the table
116
116
}
117
-
// [END bigquery_java_untracked]
117
+
// [END ]
118
118
returntables;
119
119
}
120
-
120
+
121
121
/**
122
122
* Example of getting a table in the dataset.
123
123
*/
124
124
// [TARGET get(String, TableOption...)]
125
125
// [VARIABLE “my_table”]
126
126
publicTablegetTable(StringtableName) {
127
-
// [START bigquery_java_untracked]
127
+
// [START ]
128
128
Tabletable = dataset.get(tableName);
129
-
// [END bigquery_java_untracked]
129
+
// [END ]
130
130
returntable;
131
131
}
132
-
132
+
133
133
/**
134
134
* Example of creating a table in the dataset with schema and time partitioning.
0 commit comments