Skip to content

Commit ea71376

Browse files
Require a partition filter for standard tables (#1132)
* Require a partition filter for standard tables * Upgrade to latest version of m-lab/go * go mod tidy
1 parent ea79b5e commit ea71376

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

cmd/update-schema/update.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ func CreateOrUpdate(client *bigquery.Client, schema bigquery.Schema, project, da
134134
log.Println("Successfully created dataset for", pdt)
135135
}
136136

137-
err = pdt.UpdateTable(ctx, client, schema)
137+
partitioning := &bigquery.TimePartitioning{
138+
Field: partField,
139+
}
140+
141+
err = pdt.UpdateTable(ctx, client, schema, partitioning)
138142
if err == nil {
139143
log.Println("Successfully updated", pdt)
140144
return 0
@@ -147,10 +151,6 @@ func CreateOrUpdate(client *bigquery.Client, schema bigquery.Schema, project, da
147151
return 1
148152
}
149153

150-
partitioning := &bigquery.TimePartitioning{
151-
Field: partField,
152-
}
153-
154154
err = pdt.CreateTable(ctx, client, schema, "", partitioning, nil)
155155
if err == nil {
156156
log.Println("Successfully created", pdt)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/iancoleman/strcase v0.2.0
1515
github.com/kr/pretty v0.3.0
1616
github.com/m-lab/etl-gardener v0.0.0-20220706163049-f6a4eced2192
17-
github.com/m-lab/go v0.1.66
17+
github.com/m-lab/go v0.1.72
1818
github.com/m-lab/ndt-server v0.20.18
1919
github.com/m-lab/tcp-info v1.5.3
2020
github.com/m-lab/traceroute-caller v0.10.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ github.com/m-lab/annotation-service v0.0.0-20210713124633-fa227b3d5b2f h1:dLJUar
270270
github.com/m-lab/annotation-service v0.0.0-20210713124633-fa227b3d5b2f/go.mod h1:bW5A2AmUqyh6kGbmu4X8fYK2pRcfTvTjAXW/+4VQZUA=
271271
github.com/m-lab/etl-gardener v0.0.0-20220706163049-f6a4eced2192 h1:kplK/Eyw/IepsFGWW365hEzaI7rz/SoRAfiCo/SxX24=
272272
github.com/m-lab/etl-gardener v0.0.0-20220706163049-f6a4eced2192/go.mod h1:JMTxQHudYLHNUf700okKbrE9ZbPA4e9Ri2s4Z34tj4o=
273-
github.com/m-lab/go v0.1.66 h1:adDJILqKBCkd5YeVhCrrjWkjoNRtDzlDr6uizWu5/pE=
274-
github.com/m-lab/go v0.1.66/go.mod h1:O1D/EoVarJ8lZt9foANcqcKtwxHatBzUxXFFyC87aQQ=
273+
github.com/m-lab/go v0.1.72 h1:M1A/qUQb1JXdYFHIboiu5YrHSlvBCgDbGjZuxnekDRQ=
274+
github.com/m-lab/go v0.1.72/go.mod h1:BirARfHWjjXHaCGNyWCm/CKW1OarjuEj8Yn6Z2rc0M4=
275275
github.com/m-lab/ndt-server v0.20.18 h1:lcfeHHw/kyI4zDhJKBPc4r5I0hR5BKPqAY1LIhJ6xmo=
276276
github.com/m-lab/ndt-server v0.20.18/go.mod h1:NQyIilZvNVU3+EPYKmZWuZ2mHOPVwqD7c1gEPtkb+MA=
277277
github.com/m-lab/tcp-info v1.5.3 h1:4IspTPcNc8D8LNRvuFnID8gDiz+hxPAtYvpKZaiGGe8=

0 commit comments

Comments
 (0)