-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat(bigquery): add support for allowing Javascript UDFs to indicate determinism #3534
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
Conversation
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…cloud-go into fr-routine-determinism
processed = true | ||
} | ||
if !processed { | ||
panic(fmt.Sprintf("DeterminismLevel should be either type string or RoutineDetermism in update, got %T", rm.DeterminismLevel)) |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
🤖 I have created a release \*beep\* \*boop\* --- ## [1.15.0](https://www.github.com/googleapis/google-cloud-go/compare/bigquery/v1.14.0...v1.15.0) (2021-01-14) ### Features * **bigquery:** add reservation usage stats to query statistics ([#3403](https://www.github.com/googleapis/google-cloud-go/issues/3403)) ([112bcde](https://www.github.com/googleapis/google-cloud-go/commit/112bcdeb7cee1b44f337d3e5398a0d0820e93162)) * **bigquery:** add support for allowing Javascript UDFs to indicate determinism ([#3534](https://www.github.com/googleapis/google-cloud-go/issues/3534)) ([2f417a3](https://www.github.com/googleapis/google-cloud-go/commit/2f417a39d93402fbb1e5e3001645019782d7d656)), refs [#3533](https://www.github.com/googleapis/google-cloud-go/issues/3533) ### Bug Fixes * **bigquery:** address possible panic due to offset checking in handleInsertErrors ([#3524](https://www.github.com/googleapis/google-cloud-go/issues/3524)) ([5288511](https://www.github.com/googleapis/google-cloud-go/commit/52885115af3e95cdfd1ec784837fb1df7fe01446)), refs [#3519](https://www.github.com/googleapis/google-cloud-go/issues/3519) This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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