-
Notifications
You must be signed in to change notification settings - Fork 545
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 session support #15699
Conversation
* Add create_session and session_id params to Project#query_job * Add session_id param to Project#query * Add create_session and session_id params to Dataset#query_job * Add session_id param to Dataset#query * Add Job#session_id * Add QueryJob::Updater#create_session= * Add QueryJob::Updater#session_id= closes: googleapis#15553
62b5373
to
4c1568f
Compare
acceptance test failure is a flake:
|
@@ -1244,6 +1244,8 @@ def routines token: nil, max: nil, filter: nil | |||
# Flattens all nested and repeated fields in the query results. The | |||
# default value is `true`. `large_results` parameter must be `true` if | |||
# this is set to `false`. | |||
# @param [Integer] maximum_billing_tier Deprecated: Change the billing | |||
# tier to allow high-compute queries. |
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.
If this is deprecated, can you include a note suggesting what to use instead?
(There's a similar place in project.rb.)
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.
Yes, will do, thanks.
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.
Updated.
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 looks like this change hides the connection properties and only exposes session_id as it's own property? How much more work is it to expose the connection properties in a more general fashion?
@shollyman Thanks for asking about this. Typically in the handwritten Ruby clients we try to simplify and flatten the API surface to make things easier for users by managing intermediate value objects that only have a field or two. The current list of connection properties, which is described as having only two simple properties ( data = dataset.query "SELECT * FROM temptable", session_id: job.session_id with data = dataset.query "SELECT * FROM temptable", connection_properties: [{ "session_id": job.session_id }] Composing this It really depends on whether more properties will be added, and how many? Are conn_props = [
{ "session_id": job.session_id },
{ "time_zone": time_zone },
{ "new_prop": "abc" }
]
data_a = dataset.query "SELECT * FROM temptable_a", connection_properties: conn_props
data_b = dataset.query "SELECT * FROM temptable_b", connection_properties: conn_props
data_c = dataset.query "SELECT * FROM temptable_c", connection_properties: conn_props Given the examples above, let me know your guesses about the future and your preference! |
RE: other properties, I know of a third one coming soon for associating queries to specific workload profiles. So the number remains small, but is growing. I think it's reasonable to just expose session now, and expand to a more general connectionproperties feature later, if there's no conflict/oddity with having both specific property and the general access to connection properties hung off the query config. |
@dazuma Any thoughts on this? Does it seem worth it to have a |
I think it makes sense to keep the separate |
@shollyman Does this sound good? If so, any other concerns on this PR? |
@quartzmo Seth is currently OOO but will reply shortly. :) |
Merging with guidance from @d-torres. |
create_session
andsession_id
params toProject#query_job
session_id
param toProject#query
create_session
andsession_id
params toDataset#query_job
session_id
param toDataset#query
Job#session_id
QueryJob::Updater#create_session=
QueryJob::Updater#session_id=
closes: #15553