Skip to content

Struct has only getStructList, no get single Struct #3114

@ChengyuanZhao

Description

@ChengyuanZhao

I'm working on our GCP Spring Data integration for Spanner (https://github.com/spring-cloud/spring-cloud-gcp/tree/master/spring-cloud-gcp-data-spanner), and noticed that Struct has getter methods for singular or array for all types other than Struct.

I know that STRUCTs can only be created in SQL queries and that STRUCTs are only allowed as ARRAYs of STRUCTs at the root level of the query. This lines up with only having the getStructList method, but
STRUCTs can have nested STRUCTs singularly ( like STRUCT<int64, STRUCT<boolean,string>> ). How can we access that inner STRUCT in java? Would it just be getting the first element of getStructList's result?

Thanks!

@balopat FYI

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions