-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
BigQuery jobs.insert
needs both upload
(for configuration.load
) and doit
(for configuration.query
, .extract
and .copy
)
#191
Comments
Confirmed! If I remove the |
See Byron#191 and https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/insert This makes it possible to use: - `configuration.query` - `configuration.extract` - `configuration.copy` ...but it breaks `configuration.load`.
Here's a version of As mentioned above, I've verified that |
Thanks so much for taking the time to write things down so that it's perfectly possible to follow you, and of course for the praise :). I also think that the issue you encountered must be taken into consideration for the next iteration of this API generator here: #189 . Your fix could be merged, but is likely to be overwritten next time someone runs |
Oh, yeah, my "fix" isn't mergeable as is, because it breaks The right fix, I think, it to change Does this make sense? |
Yes it does, and the suggested fix should be relatively easy to do, too.
These days I am rather afraid to touch the 'mako' based build system,
merely because I haven't done so in a while and I know there are
essentially no tests :D.
…On Tue, Jun 5, 2018 at 2:40 PM Eric Kidd ***@***.***> wrote:
Oh, yeah, my "fix" isn't mergeable as is, because it breaks
configuration.load while fixing configuration.query, configuration.extract
and configuration.copy. That's just our internal workaround so I can test
some other stuff.
The right fix, I think, it to change mbuild.mako to always generate a pub
fn doit(&self), and to *additionally* generate a completely separate
upload function when the JSON file indicates that is possible. This could
do done with some copying and pasting in mkbuild.mako to (1) always make
doit public with no stream or MIME argument, and to (2) fix upload to
call a new upload_helper function instead of doit.
Does this make sense?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#191 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAD4hh21fp7X0q3OldTzMP45G4KuFmr8ks5t5nw9gaJpZM4Uamgo>
.
|
@Byron just curious if you plan to move forward on this? |
@Byron checking in on this |
@Byron any word? |
Apologies for the late reply. |
I am closing this issue as since then a lot has changed. All crates are now |
Hello! I've been experimenting with BigQuery and Rust and I've been I've been really impressed with the
google-bigquery2
crate. I managed to get OAuth2 and some simple queries working, and everything worked beautifully.However, I ran into an interesting complication. The
hub.jobs().query(...)
is meant for small queries that output a few hundred or a few thousand rows of JSON. Larger queries need to be run usingjobs().insert(...)
with aconfiguration.query
structure, and the results need to be exported to Google Cloud Storage using the same API with aconfiguration.extract
structure.But this means that
JobInsertCall
actually needs both anupload
method, and adoit
method! Specifically, if you look at the documentation here, the breakdown appears to be:configuration.load
: Needsupload
.configuration.query
: Needs a regulardoit
.configuration.extract
: Needs a regulardoit
.configuration.copy
: Needs a regulardoit
.But
JobInsertCall
has a privatedoit
method that only provides an implementation forupload
usingPOST https://www.googleapis.com/upload/bigquery/v2/projects/projectId/jobs
, and which has no access to regulardoit
usingPOST https://www.googleapis.com/bigquery/v2/projects/projectId/jobs
.The key code appears to be in mbuild.mako, which is set up to generate either a public
doit
function, or both a publicupload
function and a privatedoit
function that can only be used to help implementupload
.The error that BigQuery gives me is:
I would be happy to submit a PR, but this involves a refactoring of
mbuild.mako
. Is this something that you would prefer to do yourself? Or would you be willing to explain how you'd like the code to be refactored?I'm going to go ahead and modify my local copy to get rid of
upload_action
on this endpoint, regenerate everything, and verify that it works as expected. If it would be useful, I could also supply you with a test program.Thank you for a very helpful and well-built library, and for any advice you can provide!
The text was updated successfully, but these errors were encountered: