-
Notifications
You must be signed in to change notification settings - Fork 1.5k
spanner: support all structpb.isValue_Kind types in getGenericValue #7456
Description
Is your feature request related to a problem? Please describe.
I am unable to use (*spanner.Row).ToStruct() for a table with an ARRAY field because spanner.getGenericValue does not check for structpb.Value_ListValue type (which would map naturally to structpb.ListValue) and instead returns an error.
Describe the solution you'd like
Check for structpb.Value_ListValue (and structpb.Value_StructValue) and map to the appropriate return value within spanner.getGenericValue so that folks can use those corresponding underlying data types with custom decoding.
Describe alternatives you've considered
I changed the data type of that field in the interim, but that was only because this is a new, prototype table; anyone with a mature table they want to start using with this sdk would have to run a migration first, which is a relatively heavy-handed workaround when the real solution seems like a 4-line (two extra switch conditions) no-brainer fix.
Additional context
Add any other context or screenshots about the feature request here.