-
Notifications
You must be signed in to change notification settings - Fork 1.1k
BigQuery: support /upload
method for loading data from local files.
#1392
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
Comments
Actually, I see we have a LoadJobConfiguration. http://googlecloudplatform.github.io/google-cloud-java/0.5.1/apidocs/com/google/cloud/bigquery/LoadJobConfiguration.html That might be sufficient. |
Tim have a look at BigQuery.writer(), it allows you to upload a file in chunks (generally a good idea as they tend to be quite big files). It should be rather simple to write a whole file using it. |
Thanks for the pointer. |
Can we close this? |
Is there a way to get the Job the writer must create? The Python version is able to get the number of rows written in it's sample. I am trying to improve the snippets for this (there are no integration tests) and having the returned data from the Job would be really useful. |
Or even getting the Job ID would be useful. Then I can fetch the job results after finishing my writes. |
I need to look into this. I don't know any way of getting the job metadata/id when using resumable upload: the open request just returns the Upload ID, all subsequent POST/PUT seem to have empty response body. |
Thanks. I'll dig into it, too. |
My current thought is making BigQueryRpc.open() return a Job instead of a String. I will attempt to get a PR out for this. |
Tim I was wrong. The last call of a chunked upload returns all the metadata of the just created job. We can put #1394 on hold until I fix this. I will probably make |
@mziccard Thanks. That sounds like a great solution. |
Thanks for catching this, I have always assumed that the job metadata wasn't available and I couldn't be more wrong :) |
I'm getting an error:
when trying to use this new functionality in the snippets like:
|
I think it should be a Load Job, not a Copy Job. |
Ah, setting Is this desired behavior? @mziccard |
I tied the example, it seems the issue still there. It happens when my csv data was not prepared well. I'm using cloud version below: |
🤖 I have created a release *beep* *boop* --- ## [2.2.4](googleapis/java-bigquerydatatransfer@v2.2.3...v2.2.4) (2022-06-13) ### Dependencies * update dependency com.google.cloud:google-cloud-bigquery to v2.13.2 ([#1388](googleapis/java-bigquerydatatransfer#1388)) ([5366270](googleapis/java-bigquerydatatransfer@5366270)) * update dependency com.google.cloud:google-cloud-pubsub to v1.119.1 ([#1387](googleapis/java-bigquerydatatransfer#1387)) ([578c028](googleapis/java-bigquerydatatransfer@578c028)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
…3.0 (googleapis#1392) [](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.12.0` -> `2.13.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-asset). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yMTYuMCIsInVwZGF0ZWRJblZlciI6IjMyLjIxNi4wIn0=-->
🤖 I have created a release *beep* *boop* --- ## [3.7.1](https://togithub.com/googleapis/java-asset/compare/v3.7.0...v3.7.1) (2022-10-07) ### Dependencies * Update dependency com.google.api.grpc:proto-google-cloud-orgpolicy-v1 to v2.3.6 ([googleapis#1390](https://togithub.com/googleapis/java-asset/issues/1390)) ([4219b66](https://togithub.com/googleapis/java-asset/commit/4219b66da58325f5a133caa84243dc0958d90149)) * Update dependency com.google.api.grpc:proto-google-cloud-os-config-v1 to v2.5.6 ([googleapis#1382](https://togithub.com/googleapis/java-asset/issues/1382)) ([3abde9e](https://togithub.com/googleapis/java-asset/commit/3abde9e4130d62d9e6857dd3b016be88691bd7f4)) * Update dependency com.google.api.grpc:proto-google-cloud-pubsub-v1 to v1.102.20 ([googleapis#1384](https://togithub.com/googleapis/java-asset/issues/1384)) ([5904111](https://togithub.com/googleapis/java-asset/commit/5904111205fc7c698703eb8db805b159a6513389)) * Update dependency com.google.api.grpc:proto-google-identity-accesscontextmanager-v1 to v1.4.5 ([googleapis#1383](https://togithub.com/googleapis/java-asset/issues/1383)) ([48f2dd8](https://togithub.com/googleapis/java-asset/commit/48f2dd863c23ec3fffb24970046cab6795a64045)) * Update dependency com.google.cloud:google-cloud-bigquery to v2.17.0 ([googleapis#1386](https://togithub.com/googleapis/java-asset/issues/1386)) ([d3cf534](https://togithub.com/googleapis/java-asset/commit/d3cf534180a8b0c4a421ff52a998b43edd502e6c)) * Update dependency com.google.cloud:google-cloud-core to v2.8.20 ([googleapis#1380](https://togithub.com/googleapis/java-asset/issues/1380)) ([113b74e](https://togithub.com/googleapis/java-asset/commit/113b74e29f05047ba3eb22cee370b2b35b133991)) * Update dependency com.google.cloud:google-cloud-pubsub to v1.120.20 ([googleapis#1385](https://togithub.com/googleapis/java-asset/issues/1385)) ([792d9a2](https://togithub.com/googleapis/java-asset/commit/792d9a2aa2253e4cb6541c587810aab936aa9d81)) * Update dependency com.google.cloud:google-cloud-resourcemanager to v1.5.6 ([googleapis#1391](https://togithub.com/googleapis/java-asset/issues/1391)) ([9afc924](https://togithub.com/googleapis/java-asset/commit/9afc924fbe87b481dc3b731935d3dc021e1bae00)) * Update dependency com.google.cloud:google-cloud-storage to v2.13.0 ([googleapis#1392](https://togithub.com/googleapis/java-asset/issues/1392)) ([9660ee4](https://togithub.com/googleapis/java-asset/commit/9660ee42c68e7cb88e0d6867ac46f2cd6056ca17)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
See documentation: https://cloud.google.com/bigquery/loading-data-post-request
Python, PHP, Ruby, and Node.js provide an upload-from-file method on the Table object.
This is blocking documentation samples.
The text was updated successfully, but these errors were encountered: