Feature/default and generated columns - #501
Open
aseering wants to merge 3 commits into
Open
Conversation
aseering
requested review from
IsmailMehdi,
helloeve and
prernakakkar-google
as code owners
July 17, 2026 20:55
IsmailMehdi
approved these changes
Jul 18, 2026
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I thought I had posted this months ago but it seemingly got lost somewhere, apologies!
This change updates the data ingestion logic. For Spanner:
The underlying problem is as follows: Spanner requires that all tables contain a PK, and that all PK values be unique. Some of our datasets do not guarantee uniqueness. The recommended workaround in this case is to construct a synthetic column where each row is a UUID, or a value from a sequence, or otherwise some synthetic and guaranteed-unique value. (Then just ignore this column; let Spanner manage and use it itself.)
Some of our schemas do this. Which is fine.
The issue then is, the data loader tries to populate all columns on the table, and it errors out if it can't do so. Populating generated columns with data from a .csv file isn't a correct thing to do. (They're generated and managed by the database; they're not allowed to be provided by the user.) Populating columns with a DEFAULT clause is permissible, but not required, and not desired for this use case. This PR adds some logic to enable those use cases.