-
Notifications
You must be signed in to change notification settings - Fork 1.1k
BigQuery: Add routines support #5591
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
Conversation
|
Failure is due to unrelated flaky test in BQ, sent #5592 to address. |
Codecov Report
@@ Coverage Diff @@
## master #5591 +/- ##
============================================
+ Coverage 46.71% 47.09% +0.37%
- Complexity 24647 25078 +431
============================================
Files 2351 2389 +38
Lines 256185 259732 +3547
Branches 29333 29397 +64
============================================
+ Hits 119688 122317 +2629
- Misses 127575 128454 +879
- Partials 8922 8961 +39
Continue to review full report at Codecov.
|
| } | ||
|
|
||
| /** Returns an option to specify the maximum number of models returned per page. */ | ||
| public static RoutineListOption pageSize(long pageSize) { |
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.
Should this be package private? (Same with other public methods in package private classes)
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.
It's probably reasonable, we extend Option but don't appear to extend each of the various typed options beyond that. Filed https://github.com/googleapis/google-cloud-java/issues/5728 to followup on visibility more generally.
This adds java support for bigquery routines, which enables API access to a persistent functions and (soon) stored procedures. Routines exist inside of BigQuery datasets, just like tables and BQML models.
UDF documentation:
https://cloud.google.com/bigquery/docs/reference/standard-sql/user-defined-functions
Routines REST documentation:
https://cloud.google.com/bigquery/docs/reference/rest/v2/routines
This PR adds:
CRUD operations for manipulating Routine resources. It models the same structure used for Tables and Models. There's a RoutineId class for the qualified reference, a RoutineInfo for metadata and a Routine class for binding to the service operations like create/update/delete. Submessages like arguments (RoutineArgument) are also implemented as classes.
StandardSQLDataType,StandardSQLField,StandardSQLStructType veneers for communicating type information using standard sql typing. These are used for communicating datatype information for inputs/outputs in routines.
Augments query stats: In addition to using the API directly, you can also manipulate routines using the query language (e.g. CREATE FUNCTION ... AS ...). Statistics provided as part of the query job include the statement type, and when using appropriate DDL queries the DDL target routine.
There's some other cleanup around typos/docs, as well as filling in missing things like statements in the StatementType enum.