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

feat(bigquery): add support for allowing Javascript UDFs to indicate determinism #3534

Merged

Conversation

shollyman
Copy link
Contributor

BigQuery supports javascript UDFs, which allow users to define function
bodies to be executed via javascrtipt. Allowing users to indicate
determinism level of the UDF helps the query engine make more efficient
choices around aspects like query caching.

Fixes: #3533

BigQuery supports javascript UDFs, which allow users to define function
bodies to be executed via javascrtipt.  Allowing users to indicate
determinism level of the UDF helps the query engine make more efficient
choices around aspects like query caching.

Fixes: googleapis#3533
@shollyman shollyman requested a review from a team as a code owner January 12, 2021 17:56
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jan 12, 2021
@codyoss codyoss changed the title feat: add support for allowing Javascript UDFs to indicate determinism feat(bigquery): add support for allowing Javascript UDFs to indicate determinism Jan 12, 2021
Copy link
Member

@codyoss codyoss left a comment

Choose a reason for hiding this comment

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

LGTM

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the BigQuery API. label Jan 13, 2021
@shollyman shollyman requested a review from tswast January 13, 2021 18:32
processed = true
}
if !processed {
panic(fmt.Sprintf("DeterminismLevel should be either type string or RoutineDetermism in update, got %T", rm.DeterminismLevel))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why panic instead of returning error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This mimics the behavior of the converters in https://pkg.go.dev/cloud.google.com/go/internal/optional. All the other fields panic if you use incorrect type, so yielding a custom error for the one field seems a mismatch.

@shollyman shollyman added the automerge Merge the pull request once unit tests and other checks pass. label Jan 14, 2021
@gcf-merge-on-green gcf-merge-on-green bot merged commit 2f417a3 into googleapis:master Jan 14, 2021
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jan 14, 2021
@shollyman shollyman deleted the fr-routine-determinism branch January 14, 2021 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bigquery: add Determinism to RoutineMetadata
3 participants