- bigquery:
- Support filtering listed jobs by min/max creation time.
- Support data clustering (https://godoc.org/cloud.google.com/go/bigquery#Clustering).
- Include job creator email in Job struct.
- bigtable:
- Add
RowSampleFilter
. - emulator: BREAKING BEHAVIOR CHANGE: Regexps in row, family, column and value filters
must match the entire target string to succeed. Previously, the emulator was
succeeding on partial matches.
NOTE: As of this release, this change only affects the emulator when run
from this repo (bigtable/cmd/emulator/cbtemulator.go). The version launched
from
gcloud
will be updated in a subsequentgcloud
release.
- Add
- dataproc: Add apiv1beta2 client.
- datastore: Save non-nil pointer fields on omitempty.
- logging: populate Entry.Trace from the HTTP X-Cloud-Trace-Context header.
- logging/logadmin: Support writer_identity and include_children.
- pubsub:
- Support labels on topics and subscriptions.
- Support message storage policy for topics.
- Use the distribution of ack times to determine when to extend ack deadlines.
The only user-visible effect of this change should be that programs that
call only
Subscription.Receive
need no IAM permissions other thanPub/Sub Subscriber
.
- storage:
- Support predefined ACLs.
- Support additional ACL fields other than Entity and Role.
- Support bucket websites.
- Support bucket logging.
- Added Code of Conduct
- bigtable:
- cbt: Support a GC policy of "never".
- errorreporting:
- Support User.
- Close now calls Flush.
- Use OnError (previously ignored).
- Pass through the RPC error as-is to OnError.
- httpreplay: A tool for recording and replaying HTTP requests (for the bigquery and storage clients in this repo).
- kms: v1 client added
- logging: add SourceLocation to Entry.
- storage: improve CRC checking on read.
- bigquery: Support for the NUMERIC type.
- bigtable:
- cbt: Optionally specify columns for read/lookup
- Support instance-level administration.
- oslogin: New client for the OS Login API.
- pubsub:
- The package is now stable. There will be no further breaking changes.
- Internal changes to improve Subscription.Receive behavior.
- storage: Support updating bucket lifecycle config.
- spanner: Support struct-typed parameter bindings.
- texttospeech: New client for the Text-to-Speech API.
- bigquery: Add DDL stats to query statistics.
- bigtable:
- cbt: Add cells-per-column limit for row lookup.
- cbt: Make it possible to combine read filters.
- dlp: v2beta2 client removed. Use the v2 client instead.
- firestore, spanner: Fix compilation errors due to protobuf changes.
-
bigtable:
- cbt: Support cells per column limit for row read.
- bttest: Correctly handle empty RowSet.
- Fix ReadModifyWrite operation in emulator.
- Fix API path in GetCluster.
-
bigquery:
- BEHAVIOR CHANGE: Retry on 503 status code.
- Add dataset.DeleteWithContents.
- Add SchemaUpdateOptions for query jobs.
- Add Timeline to QueryStatistics.
- Add more stats to ExplainQueryStage.
- Support Parquet data format.
-
datastore:
- Support omitempty for times.
-
dlp:
- BREAKING CHANGE: Remove v1beta1 client. Please migrate to the v2 client, which is now out of beta.
- Add v2 client.
-
firestore:
- BEHAVIOR CHANGE: Treat set({}, MergeAll) as valid.
-
iam:
- Support JWT signing via SignJwt callopt.
-
profiler:
- BEHAVIOR CHANGE: PollForSerialOutput returns an error when context.Done.
- BEHAVIOR CHANGE: Increase the initial backoff to 1 minute.
- Avoid returning empty serial port output.
-
pubsub:
- BEHAVIOR CHANGE: Don't backoff during next retryable error once stream is healthy.
- BEHAVIOR CHANGE: Don't backoff on EOF.
- pstest: Support Acknowledge and ModifyAckDeadline RPCs.
-
redis:
- Add v1 beta Redis client.
-
spanner:
- Support SessionLabels.
-
speech:
- Add api v1 beta1 client.
-
storage:
- BEHAVIOR CHANGE: Retry reads when retryable error occurs.
- Fix delete of object in requester-pays bucket.
- Support KMS integration.
-
bigquery:
- Add OpenCensus tracing.
-
firestore:
- BREAKING CHANGE: If a document does not exist, return a DocumentSnapshot whose Exists method returns false. DocumentRef.Get and Transaction.Get return the non-nil DocumentSnapshot in addition to a NotFound error. DocumentRef.GetAll and Transaction.GetAll return a non-nil DocumentSnapshot instead of nil.
- Add DocumentIterator.Stop. Call Stop whenever you are done with a DocumentIterator.
- Added Query.Snapshots and DocumentRef.Snapshots, which provide realtime notification of updates. See https://cloud.google.com/firestore/docs/query-data/listen.
- Canceling an RPC now always returns a grpc.Status with codes.Canceled.
-
spanner:
- Add
CommitTimestamp
, which supports inserting the commit timestamp of a transaction into a column.
- Add
-
bigquery: Support SchemaUpdateOptions for load jobs.
-
bigtable:
- Add SampleRowKeys.
- cbt: Support union, intersection GCPolicy.
- Retry admin RPCS.
- Add trace spans to retries.
-
datastore: Add OpenCensus tracing.
-
firestore:
- Fix queries involving Null and NaN.
- Allow Timestamp protobuffers for time values.
-
logging: Add a WriteTimeout option.
-
spanner: Support Batch API.
-
storage: Add OpenCensus tracing.
-
bigquery:
- Support customer-managed encryption keys.
-
bigtable:
- Improved emulator support.
- Support GetCluster.
-
datastore:
- Add general mutations.
- Support pointer struct fields.
- Support transaction options.
-
firestore:
- Add Transaction.GetAll.
- Support document cursors.
-
logging:
- Support concurrent RPCs to the service.
- Support per-entry resources.
-
profiler:
- Add config options to disable heap and thread profiling.
- Read the project ID from $GOOGLE_CLOUD_PROJECT when it's set.
-
pubsub:
- BEHAVIOR CHANGE: Release flow control after ack/nack (instead of after the callback returns).
- Add SubscriptionInProject.
- Add OpenCensus instrumentation for streaming pull.
-
storage:
- Support CORS.
-
bigquery:
- Marked stable.
- Schema inference of nullable fields supported.
- Added TimePartitioning to QueryConfig.
-
firestore: Data provided to DocumentRef.Set with a Merge option can contain Delete sentinels.
-
logging: Clients can accept parent resources other than projects.
-
pubsub:
- pubsub/pstest: A lighweight fake for pubsub. Experimental; feedback welcome.
- Support updating more subscription metadata: AckDeadline, RetainAckedMessages and RetentionDuration.
-
oslogin/apiv1beta: New client for the Cloud OS Login API.
-
rpcreplay: A package for recording and replaying gRPC traffic.
-
spanner:
- Add a ReadWithOptions that supports a row limit, as well as an index.
- Support query plan and execution statistics.
- Added OpenCensus support.
-
storage: Clarify checksum validation for gzipped files (it is not validated when the file is served uncompressed).
- firestore BREAKING CHANGES:
-
Remove UpdateMap and UpdateStruct; rename UpdatePaths to Update. Change
docref.UpdateMap(ctx, map[string]interface{}{"a.b", 1})
todocref.Update(ctx, []firestore.Update{{Path: "a.b", Value: 1}})
Change
docref.UpdateStruct(ctx, []string{"Field"}, aStruct)
todocref.Update(ctx, []firestore.Update{{Path: "Field", Value: aStruct.Field}})
-
Rename MergePaths to Merge; require args to be FieldPaths
-
A value stored as an integer can be read into a floating-point field, and vice versa.
-
- bigtable/cmd/cbt:
- Support deleting a column.
- Add regex option for row read.
- spanner: Mark stable.
- storage:
- Add Reader.ContentEncoding method.
- Fix handling of SignedURL headers.
- bigquery:
- If Uploader.Put is called with no rows, it returns nil without making a call.
- Schema inference supports the "nullable" option in struct tags for non-required fields.
- TimePartitioning supports "Field".
-
Other bigquery changes:
JobIterator.Next
returns*Job
; removedJobInfo
(BREAKING CHANGE).- UseStandardSQL is deprecated; set UseLegacySQL to true if you need Legacy SQL.
- Uploader.Put will generate a random insert ID if you do not provide one.
- Support time partitioning for load jobs.
- Support dry-run queries.
- A
Job
remembers its last retrieved status. - Support retrieving job configuration.
- Support labels for jobs and tables.
- Support dataset access lists.
- Improve support for external data sources, including data from Bigtable and Google Sheets, and tables with external data.
- Support updating a table's view configuration.
- Fix uploading civil times with nanoseconds.
-
storage:
- Support PubSub notifications.
- Support Requester Pays buckets.
-
profiler: Support goroutine and mutex profile types.
-
firestore: beta release. See the announcement.
-
errorreporting: The existing package has been redesigned.
-
errors: This package has been removed. Use errorreporting.
-
bigquery BREAKING CHANGES:
- Standard SQL is the default for queries and views.
Table.Create
takesTableMetadata
as a second argument, instead of options.Dataset.Create
takesDatasetMetadata
as a second argument.DatasetMetadata
fieldID
renamed toFullID
TableMetadata
fieldID
renamed toFullID
-
Other bigquery changes:
- The client will append a random suffix to a provided job ID if you set
AddJobIDSuffix
to true in a job config. - Listing jobs is supported.
- Better retry logic.
- The client will append a random suffix to a provided job ID if you set
-
vision, language, speech: clients are now stable
-
monitoring: client is now beta
-
profiler:
- Rename InstanceName to Instance, ZoneName to Zone
- Auto-detect service name and version on AppEngine.
-
bigquery: UseLegacySQL options for CreateTable and QueryConfig. Use these options to continue using Legacy SQL after the client switches its default to Standard SQL.
-
bigquery: Support for updating dataset labels.
-
bigquery: Set DatasetIterator.ProjectID to list datasets in a project other than the client's. DatasetsInProject is no longer needed and is deprecated.
-
bigtable: Fail ListInstances when any zones fail.
-
spanner: support decoding of slices of basic types (e.g. []string, []int64, etc.)
-
logging/logadmin: UpdateSink no longer creates a sink if it is missing (actually a change to the underlying service, not the client)
-
profiler: Service and ServiceVersion replace Target in Config.
-
pubsub: Subscription.Receive now uses streaming pull.
-
pubsub: add Client.TopicInProject to access topics in a different project than the client.
-
errors: renamed errorreporting. The errors package will be removed shortly.
-
datastore: improved retry behavior.
-
bigquery: support updates to dataset metadata, with etags.
-
bigquery: add etag support to Table.Update (BREAKING: etag argument added).
-
bigquery: generate all job IDs on the client.
-
storage: support bucket lifecycle configurations.
-
Clients for spanner, pubsub and video are now in beta.
-
New client for DLP.
-
spanner: performance and testing improvements.
-
storage: requester-pays buckets are supported.
-
storage, profiler, bigtable, bigquery: bug fixes and other minor improvements.
-
pubsub: bug fixes and other minor improvements
-
pubsub: Subscription.ModifyPushConfig replaced with Subscription.Update.
-
pubsub: Subscription.Receive now runs concurrently for higher throughput.
-
vision: cloud.google.com/go/vision is deprecated. Use cloud.google.com/go/vision/apiv1 instead.
-
translation: now stable.
-
trace: several changes to the surface. See the link below.
-
pubsub: Replace
sub.ModifyPushConfig(ctx, pubsub.PushConfig{Endpoint: "https://example.com/push"})
with
sub.Update(ctx, pubsub.SubscriptionConfigToUpdate{ PushConfig: &pubsub.PushConfig{Endpoint: "https://example.com/push"}, })
-
trace: traceGRPCServerInterceptor will be provided from *trace.Client. Given an initialized
*trace.Client
namedtc
, instead ofs := grpc.NewServer(grpc.UnaryInterceptor(trace.GRPCServerInterceptor(tc)))
write
s := grpc.NewServer(grpc.UnaryInterceptor(tc.GRPCServerInterceptor()))
-
trace trace.GRPCClientInterceptor will also provided from *trace.Client. Instead of
conn, err := grpc.Dial(srv.Addr, grpc.WithUnaryInterceptor(trace.GRPCClientInterceptor()))
write
conn, err := grpc.Dial(srv.Addr, grpc.WithUnaryInterceptor(tc.GRPCClientInterceptor()))
-
trace: We removed the deprecated
trace.EnableGRPCTracing
. Use the gRPC interceptor as a dial option as shown below when initializing Cloud package clients:c, err := pubsub.NewClient(ctx, "project-id", option.WithGRPCDialOption(grpc.WithUnaryInterceptor(tc.GRPCClientInterceptor()))) if err != nil { ... }
- Breaking changes to some autogenerated clients.
- rpcreplay package added.
- profiler package added.
- storage:
- Retry Objects.Insert call.
- Add ProgressFunc to WRiter.
- pubsub: breaking changes:
- Publish is now asynchronous (announcement).
- Subscription.Pull replaced by Subscription.Receive, which takes a callback (announcement).
- Message.Done replaced with Message.Ack and Message.Nack.
- Release of a client library for Spanner. See the blog post. Note that although the Spanner service is beta, the Go client library is alpha.
-
Beta release of BigQuery, DataStore, Logging and Storage. See the blog post.
-
bigquery:
-
struct support. Read a row directly into a struct with
RowIterator.Next
, and upload a row directly from a struct withUploader.Put
. You can also use field tags. See the [package documentation][cloud-bigquery-ref] for details. -
The
ValueList
type was removed. It is no longer necessary. Instead of
var v ValueList ... it.Next(&v) ..
use
var v []Value ... it.Next(&v) ...
-
Previously, repeatedly calling
RowIterator.Next
on the same[]Value
orValueList
would append to the slice. Now each call resets the size to zero first. -
Schema inference will infer the SQL type BYTES for a struct field of type []byte. Previously it inferred STRING.
-
The types
uint
,uint64
anduintptr
are no longer supported in schema inference. BigQuery's integer type is INT64, and those types may hold values that are not correctly represented in a 64-bit signed integer.
-
- bigquery:
- The SQL types DATE, TIME and DATETIME are now supported. They correspond to
the
Date
,Time
andDateTime
types in the newcloud.google.com/go/civil
package. - Support for query parameters.
- Support deleting a dataset.
- Values from INTEGER columns will now be returned as int64, not int. This will avoid errors arising from large values on 32-bit systems.
- The SQL types DATE, TIME and DATETIME are now supported. They correspond to
the
- datastore:
- Nested Go structs encoded as Entity values, instead of a
flattened list of the embedded struct's fields. This means that you may now have twice-nested slices, eg.
See the announcement for more details.
type State struct { Cities []struct{ Populations []int } }
- Contexts no longer hold namespaces; instead you must set a key's namespace explicitly. Also, key functions have been changed and renamed.
- The WithNamespace function has been removed. To specify a namespace in a Query, use the Query.Namespace method:
q := datastore.NewQuery("Kind").Namespace("ns")
- All the fields of Key are exported. That means you can construct any Key with a struct literal:
k := &Key{Kind: "Kind", ID: 37, Namespace: "ns"}
- As a result of the above, the Key methods Kind, ID, d.Name, Parent, SetParent and Namespace have been removed.
NewIncompleteKey
has been removed, replaced byIncompleteKey
. ReplacewithNewIncompleteKey(ctx, kind, parent)
and if you do use namespaces, make sure you set the namespace on the returned key.IncompleteKey(kind, parent)
NewKey
has been removed, replaced byNameKey
andIDKey
. ReplacewithNewKey(ctx, kind, name, 0, parent) NewKey(ctx, kind, "", id, parent)
and if you do use namespaces, make sure you set the namespace on the returned key.NameKey(kind, name, parent) IDKey(kind, id, parent)
- The
Done
variable has been removed. Replacedatastore.Done
withiterator.Done
, from the packagegoogle.golang.org/api/iterator
. - The
Client.Close
method will have a return type of error. It will return the result of closing the underlying gRPC connection. - See the announcement for more details.
- Nested Go structs encoded as Entity values, instead of a
flattened list of the embedded struct's fields. This means that you may now have twice-nested slices, eg.
-
bigquery: -
NewGCSReference
is now a function, not a method onClient
.Table.LoaderFrom
now accepts aReaderSource
, enabling loading data into a table from a file or anyio.Reader
.
-
Client.Table and Client.OpenTable have been removed. Replace
client.OpenTable("project", "dataset", "table")
with
client.DatasetInProject("project", "dataset").Table("table")
-
Client.CreateTable has been removed. Replace
client.CreateTable(ctx, "project", "dataset", "table")
with
client.DatasetInProject("project", "dataset").Table("table").Create(ctx)
-
Dataset.ListTables have been replaced with Dataset.Tables. Replace
tables, err := ds.ListTables(ctx)
with
it := ds.Tables(ctx) for { table, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: use table. }
-
Client.Read has been replaced with Job.Read, Table.Read and Query.Read. Replace
it, err := client.Read(ctx, job)
with
it, err := job.Read(ctx)
and similarly for reading from tables or queries.
-
The iterator returned from the Read methods is now named RowIterator. Its behavior is closer to the other iterators in these libraries. It no longer supports the Schema method; see the next item. Replace
for it.Next(ctx) { var vals ValueList if err := it.Get(&vals); err != nil { // TODO: Handle error. } // TODO: use vals. } if err := it.Err(); err != nil { // TODO: Handle error. }
with
for { var vals ValueList err := it.Next(&vals) if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: use vals. }
Instead of the
RecordsPerRequest(n)
option, writeit.PageInfo().MaxSize = n
Instead of the
StartIndex(i)
option, writeit.StartIndex = i
-
ValueLoader.Load now takes a Schema in addition to a slice of Values. Replace
func (vl *myValueLoader) Load(v []bigquery.Value)
with
func (vl *myValueLoader) Load(v []bigquery.Value, s bigquery.Schema)
-
Table.Patch is replace by Table.Update. Replace
p := table.Patch() p.Description("new description") metadata, err := p.Apply(ctx)
with
metadata, err := table.Update(ctx, bigquery.TableMetadataToUpdate{ Description: "new description", })
-
Client.Copy is replaced by separate methods for each of its four functions. All options have been replaced by struct fields.
-
To load data from Google Cloud Storage into a table, use Table.LoaderFrom.
Replace
client.Copy(ctx, table, gcsRef)
with
table.LoaderFrom(gcsRef).Run(ctx)
Instead of passing options to Copy, set fields on the Loader:
loader := table.LoaderFrom(gcsRef) loader.WriteDisposition = bigquery.WriteTruncate
-
To extract data from a table into Google Cloud Storage, use Table.ExtractorTo. Set fields on the returned Extractor instead of passing options.
Replace
client.Copy(ctx, gcsRef, table)
with
table.ExtractorTo(gcsRef).Run(ctx)
-
To copy data into a table from one or more other tables, use Table.CopierFrom. Set fields on the returned Copier instead of passing options.
Replace
client.Copy(ctx, dstTable, srcTable)
with
dst.Table.CopierFrom(srcTable).Run(ctx)
-
To start a query job, create a Query and call its Run method. Set fields on the query instead of passing options.
Replace
client.Copy(ctx, table, query)
with
query.Run(ctx)
-
-
Table.NewUploader has been renamed to Table.Uploader. Instead of options, configure an Uploader by setting its fields. Replace
u := table.NewUploader(bigquery.UploadIgnoreUnknownValues())
with
u := table.NewUploader(bigquery.UploadIgnoreUnknownValues()) u.IgnoreUnknownValues = true
-
pubsub: remove
pubsub.Done
. Useiterator.Done
instead, whereiterator
is the packagegoogle.golang.org/api/iterator
.
-
storage:
-
AdminClient replaced by methods on Client. Replace
adminClient.CreateBucket(ctx, bucketName, attrs)
with
client.Bucket(bucketName).Create(ctx, projectID, attrs)
-
BucketHandle.List replaced by BucketHandle.Objects. Replace
for query != nil { objs, err := bucket.List(d.ctx, query) if err != nil { ... } query = objs.Next for _, obj := range objs.Results { fmt.Println(obj) } }
with
iter := bucket.Objects(d.ctx, query) for { obj, err := iter.Next() if err == iterator.Done { break } if err != nil { ... } fmt.Println(obj) }
(The
iterator
package is atgoogle.golang.org/api/iterator
.)Replace
Query.Cursor
withObjectIterator.PageInfo().Token
.Replace
Query.MaxResults
withObjectIterator.PageInfo().MaxSize
. -
ObjectHandle.CopyTo replaced by ObjectHandle.CopierFrom. Replace
attrs, err := src.CopyTo(ctx, dst, nil)
with
attrs, err := dst.CopierFrom(src).Run(ctx)
Replace
attrs, err := src.CopyTo(ctx, dst, &storage.ObjectAttrs{ContextType: "text/html"})
with
c := dst.CopierFrom(src) c.ContextType = "text/html" attrs, err := c.Run(ctx)
-
ObjectHandle.ComposeFrom replaced by ObjectHandle.ComposerFrom. Replace
attrs, err := dst.ComposeFrom(ctx, []*storage.ObjectHandle{src1, src2}, nil)
with
attrs, err := dst.ComposerFrom(src1, src2).Run(ctx)
-
ObjectHandle.Update's ObjectAttrs argument replaced by ObjectAttrsToUpdate. Replace
attrs, err := obj.Update(ctx, &storage.ObjectAttrs{ContextType: "text/html"})
with
attrs, err := obj.Update(ctx, storage.ObjectAttrsToUpdate{ContextType: "text/html"})
-
ObjectHandle.WithConditions replaced by ObjectHandle.If. Replace
obj.WithConditions(storage.Generation(gen), storage.IfMetaGenerationMatch(mgen))
with
obj.Generation(gen).If(storage.Conditions{MetagenerationMatch: mgen})
Replace
obj.WithConditions(storage.IfGenerationMatch(0))
with
obj.If(storage.Conditions{DoesNotExist: true})
-
storage.Done
replaced byiterator.Done
(from packagegoogle.golang.org/api/iterator
).
-
-
Package preview/logging deleted. Use logging instead.
-
Logging client replaced with preview version (see below).
-
New clients for some of Google's Machine Learning APIs: Vision, Speech, and Natural Language.
-
Preview version of a new [Stackdriver Logging][cloud-logging] client in
cloud.google.com/go/preview/logging
. This client uses gRPC as its transport layer, and supports log reading, sinks and metrics. It will replace the current client atcloud.google.com/go/logging
shortly.