Skip to content

feat(spanner): add support for handling null values in array of proto columns#7042

Merged
harshachinta merged 3 commits intogoogleapis:proto-column-enhancement-alphafrom
harshachinta:handling-null-values-in-array-of-proto-columns
Nov 17, 2022
Merged

feat(spanner): add support for handling null values in array of proto columns#7042
harshachinta merged 3 commits intogoogleapis:proto-column-enhancement-alphafrom
harshachinta:handling-null-values-in-array-of-proto-columns

Conversation

@harshachinta
Copy link
Copy Markdown
Contributor

This PR adds support for handling null values in array of proto columns.

@harshachinta harshachinta requested review from a team, olavloite and rahul2393 November 15, 2022 10:01
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: spanner Issues related to the Spanner API. labels Nov 15, 2022
// As the ENUM elements in the array are value type and not pointer type,
// we cannot support NULL values in the array
if isNull {
return errNilNotAllowed(ptr, "*[]*protoreflect.Enum")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error msg is:

... Use *[]*protoreflect.Enum, an array with pointer type elements to read Null values.

Is this expected?

Copy link
Copy Markdown
Contributor

@olavloite olavloite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with a small nit on the error message.

@rahul2393 rahul2393 requested a review from a team November 16, 2022 15:36
@rahul2393 rahul2393 requested a review from a team November 16, 2022 15:36
@rahul2393 rahul2393 requested review from a team and alvarowolfx and removed request for a team November 16, 2022 15:36
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. and removed size: s Pull request size is small. labels Nov 16, 2022
@rahul2393 rahul2393 force-pushed the handling-null-values-in-array-of-proto-columns branch from 83e345a to d797b45 Compare November 16, 2022 15:41
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: xl Pull request size is extra large. labels Nov 16, 2022
@googleapis googleapis deleted a comment from snippet-bot bot Nov 16, 2022
@enocom enocom removed their request for review November 16, 2022 16:03
@harshachinta harshachinta removed request for a team and alvarowolfx November 16, 2022 16:44
@harshachinta harshachinta merged commit b932144 into googleapis:proto-column-enhancement-alpha Nov 17, 2022
harshachinta added a commit that referenced this pull request May 7, 2024
* feat(spanner): add support for Proto Columns (#6886)

* feat(spanner): Adding support for Proto Message and Proto Enum

* feat(spanner): Add license header to new files

* code refactoring and additional checks

* nit: code changes

* go.mod update to prevent failing builds

* go.mod update to prevent failing builds

* go.mod and build_samples.sh update to prevent failing builds

* revert back grpc version

* revert back changes

* Using standard Singers example, refactoring redundant code

* code and proto refactoring

* Add proto_type_fqn for Proto Message and Proto Enum

* code refactoring

* go mod tidy: go.mod and go.sum version updates

* add changes to support compatibility between Int64 and Enum & compatibility between Bytes and Proto

* Revert "go mod tidy: go.mod and go.sum version updates"

This reverts commit 484b00c.

* add Integration Tests for Proto Message, Proto Enum, compatibility tests

* code refactoring

* code refactoring

* add unit tests for nil proto types

* Add error when nil proto message or nil enum is passed

* feat(spanner): add support for handling null value in Proto columns (#6954)

* feat(spanner): add support for handling null value in Proto columns

* code refactor: get protoTypeFqn from user defined nil types

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* Add tests for MarshalJSON and UnmarshalJSON methods

* refactoring test file

* code refactoring

* feat(spanner): add support for Array of Proto columns (#7014)

* feat(spanner): add support for array of proto columns

* refactoring comments and added negative test cases while reading array of protos

* change decoding logic of handling array of proto columns

* feat(spanner): add support for handling null values in array of proto columns (#7042)

* feat(spanner): add support for handling null values in Array of Proto Columns

* add comments for code readability

* nit: change in error message

* feat(spanner): Modify configuration for integration test and add license header (#7059)

* feat(spanner): update go-genproto dependency (#7066)

* feat(spanner): support for enum columns as keys, index and integration tests (#7091)

* feat(spanner): support for proto columns as primary key and tests for parameterized queries, primary key and indexes

* feat(spanner): close read-only transaction to prevent session leak

* feat(spanner): update table schema to have GPK on proto field

* feat(spanner): add proto changes to support proto columns feature

* feat(spanner): remove gen-proto dep overwrite for proto column support

* feat(spanner): remove gen-proto dep overwrite from kokoro build

* feat(spanner): reset array of proto, enum when null from database (#7176)

* feat(spanner): reset array of proto, enum when null from database

* feat(spanner): fix license header to fix vet.sh build

* feat(spanner): fix proto generated file to fix vet.sh build

* feat(spanner): organize imports to fix vet.sh build

* feat(spanner): golint changes to fix vet.sh build

* feat(spanner): add support for Proto column DDL (#7292)

* feat(spanner): add proto changes for Proto Columns DDL support

* feat(spanner): add Proto descriptor file and integration tests for Proto DDL feature

* feat(spanner): skip pg tests and code refactoring for proto ddl

* feat(spanner): rename NewDatabaseAdminRESTClient to NewDatabaseAdminClient due to visibility label issue fix

* feat(spanner): remove hardcoded cloud-devel host

* feat(spanner): remove hardcoded project id

* feat(spanner): revert autogenerated code

* feat(spanner): just to validate integration tests running

* feat(spanner): change copyright year

* feat(spanner): set project id for integration tests

* feat(spanner): use jsoniter instead of json for marshal and unmarshal

* feat(spanner): revert presubmit.sh changes

* chore(spanner): run integration tests in presubmit

* chore(spanner): revert presubmit.sh changes

* feat(spanner): fix json

---------

Co-authored-by: rahul2393 <irahul@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the Spanner API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants