Skip to content

BigQuery: adds load partitioned table sample and reworks create/query samples#5368

Merged
alixhami merged 1 commit into
googleapis:masterfrom
alixhami:bq-partitioning-samples
May 23, 2018
Merged

BigQuery: adds load partitioned table sample and reworks create/query samples#5368
alixhami merged 1 commit into
googleapis:masterfrom
alixhami:bq-partitioning-samples

Conversation

@alixhami
Copy link
Copy Markdown
Contributor

This PR adds a load sample for column based time partitioning, and updates the create table and query samples. The create table and query samples were leveraged from the alpha documentation, but they were not as simple as possible, which is preferred for samples. To resolve this, I used data with a simpler schema and ran a full query instead of a dry run.

These samples are meant to be similar to the other load samples, which use US state data. I uploaded a csv file to the shared bucket so that other language samples can use the same data. I also used print statements rather than asserts so that the other languages can more closely follow these samples. I noticed that when the Python sample is canonical and uses asserts, the other language samples tend to print inconsistent messages because they have no example to follow.

@alixhami alixhami added documentation api: bigquery Issues related to the BigQuery API. labels May 22, 2018
@alixhami alixhami requested review from shollyman and tswast May 22, 2018 23:41
@alixhami alixhami requested a review from lukesneeringer as a code owner May 22, 2018 23:41
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 22, 2018
Copy link
Copy Markdown
Contributor

@tswast tswast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

Comment thread docs/bigquery/snippets.py
print("This query will process {} bytes.".format(
query_job.total_bytes_processed))
rows = list(query_job)
print("{} states were admitted to the US in the 1800s".format(len(rows)))

This comment was marked as spam.

This comment was marked as spam.

Comment thread docs/bigquery/snippets.py
print("This query will process {} bytes.".format(
query_job.total_bytes_processed))
rows = list(query_job)
print("{} states were admitted to the US in the 1800s".format(len(rows)))

This comment was marked as spam.

@alixhami alixhami merged commit 872bff3 into googleapis:master May 23, 2018
@alixhami alixhami deleted the bq-partitioning-samples branch May 23, 2018 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the BigQuery API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants