Skip to content

Commit

Permalink
Require a partition filter for standard tables (#1132)
Browse files Browse the repository at this point in the history
* Require a partition filter for standard tables

* Upgrade to latest version of m-lab/go

* go mod tidy
  • Loading branch information
cristinaleonr authored Apr 5, 2024
1 parent ea79b5e commit ea71376
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions cmd/update-schema/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ func CreateOrUpdate(client *bigquery.Client, schema bigquery.Schema, project, da
log.Println("Successfully created dataset for", pdt)
}

err = pdt.UpdateTable(ctx, client, schema)
partitioning := &bigquery.TimePartitioning{
Field: partField,
}

err = pdt.UpdateTable(ctx, client, schema, partitioning)
if err == nil {
log.Println("Successfully updated", pdt)
return 0
Expand All @@ -147,10 +151,6 @@ func CreateOrUpdate(client *bigquery.Client, schema bigquery.Schema, project, da
return 1
}

partitioning := &bigquery.TimePartitioning{
Field: partField,
}

err = pdt.CreateTable(ctx, client, schema, "", partitioning, nil)
if err == nil {
log.Println("Successfully created", pdt)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/iancoleman/strcase v0.2.0
github.com/kr/pretty v0.3.0
github.com/m-lab/etl-gardener v0.0.0-20220706163049-f6a4eced2192
github.com/m-lab/go v0.1.66
github.com/m-lab/go v0.1.72
github.com/m-lab/ndt-server v0.20.18
github.com/m-lab/tcp-info v1.5.3
github.com/m-lab/traceroute-caller v0.10.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ github.com/m-lab/annotation-service v0.0.0-20210713124633-fa227b3d5b2f h1:dLJUar
github.com/m-lab/annotation-service v0.0.0-20210713124633-fa227b3d5b2f/go.mod h1:bW5A2AmUqyh6kGbmu4X8fYK2pRcfTvTjAXW/+4VQZUA=
github.com/m-lab/etl-gardener v0.0.0-20220706163049-f6a4eced2192 h1:kplK/Eyw/IepsFGWW365hEzaI7rz/SoRAfiCo/SxX24=
github.com/m-lab/etl-gardener v0.0.0-20220706163049-f6a4eced2192/go.mod h1:JMTxQHudYLHNUf700okKbrE9ZbPA4e9Ri2s4Z34tj4o=
github.com/m-lab/go v0.1.66 h1:adDJILqKBCkd5YeVhCrrjWkjoNRtDzlDr6uizWu5/pE=
github.com/m-lab/go v0.1.66/go.mod h1:O1D/EoVarJ8lZt9foANcqcKtwxHatBzUxXFFyC87aQQ=
github.com/m-lab/go v0.1.72 h1:M1A/qUQb1JXdYFHIboiu5YrHSlvBCgDbGjZuxnekDRQ=
github.com/m-lab/go v0.1.72/go.mod h1:BirARfHWjjXHaCGNyWCm/CKW1OarjuEj8Yn6Z2rc0M4=
github.com/m-lab/ndt-server v0.20.18 h1:lcfeHHw/kyI4zDhJKBPc4r5I0hR5BKPqAY1LIhJ6xmo=
github.com/m-lab/ndt-server v0.20.18/go.mod h1:NQyIilZvNVU3+EPYKmZWuZ2mHOPVwqD7c1gEPtkb+MA=
github.com/m-lab/tcp-info v1.5.3 h1:4IspTPcNc8D8LNRvuFnID8gDiz+hxPAtYvpKZaiGGe8=
Expand Down

0 comments on commit ea71376

Please sign in to comment.