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

Default values in BigQuery tables not populated #14

Open
adamagnew opened this issue Dec 12, 2024 · 2 comments · May be fixed by #26
Open

Default values in BigQuery tables not populated #14

adamagnew opened this issue Dec 12, 2024 · 2 comments · May be fixed by #26
Assignees

Comments

@adamagnew
Copy link

We've configured tables using default values for a common use case of tracking the insertion time of a row into BigQuery

{
    "name": "last_modified_timestamp",
    "type": "TIMESTAMP",
    "mode": "NULLABLE",
    "defaultValueExpression": "CURRENT_TIMESTAMP()"
}

But the WriteApi plugin doesn't compute a value for the missing column on insert, it leaves them as null.

@adamagnew
Copy link
Author

On review today, it's working as expected; very odd. Apologies, error may have been the user's.

@adamagnew
Copy link
Author

On further review, it seems like there's inconsistent behavior. I was able to force the resolution of default values by adding
managedwriter.UpdateDefaultMissingValueInterpretation(2)
to the two calls to currStream.managedstream.AppendRows in out_writeapi.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants