Search code examples
google-cloud-platformgoogle-cloud-spanner

Does Google Cloud Spanner support 'struct' type?


Seems that spanner support struct type. https://cloud.google.com/spanner/docs/data-types#struct-type

However, DDL didn't mention how to use. https://cloud.google.com/spanner/docs/data-definition-language#data_types

It's really confuse me, or I got misunderstood with the documents?


Solution

  • You are correct. Sorry for the confusion.

    Cloud Spanner doesn't support Struct as a column type. It only supports Arrays as column types, but it does return data from queries in Structs so it's a data return type.