Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempted to add support for camel case fields via storage api. #307

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

IlyaMayorski
Copy link

@IlyaMayorski IlyaMayorski commented Apr 25, 2024

The storage API streaming implementation (at least in java: https://github.com/googleapis/java-bigquerystorage/blob/8efb8131ff89b57509b4b122c75f765c62514b1c/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BQTableSchemaToProtoDescriptor.java#L145) maps the fields in the protobuff message to lower case. When a stream request is being processed and the proto buff message is unmarshalled they are in lower case (naturally) but then when the table data is being build those fields that are camelCase in the database are ignored because in the request they are lower case.

Since i cannot evaluate what the eventual outcome of replacing the mapping check with lower case might be i added a back up look up with lowercase fields. According to google cloumn names should be case-insensitive (https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#case_sensitivity)

Please advise if a better solution exists.

The storage API streaming implementation (at least in java: https://github.com/googleapis/java-bigquerystorage/blob/8efb8131ff89b57509b4b122c75f765c62514b1c/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BQTableSchemaToProtoDescriptor.java#L145) maps the fields in the protobuff message to lower case. When a stream request is being processed and the proto buff message is unmarshalled they are in lower case (naturally) but then when the table data is being build those fields that are camelCase in the database are ignored because in the request they are lower case.

Since i cannot evaluate what the eventual outcome of replacing the mapping check with lower case i added a back up look up with lowercase fields.
Please advise if a better solution exists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant