Skip to content
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: add support for table snapshot #1320

Merged
merged 8 commits into from Jun 28, 2021

Conversation

stephaniewang526
Copy link
Member

@stephaniewang526 stephaniewang526 commented May 18, 2021

Added support for operationType in CopyJobConfiguration.java and added class support for SnapshotDefinition.

Allows users to generate a persistent copy of an existing table as it were at a given point in time within the same project.
@stephaniewang526 stephaniewang526 requested a review from as a code owner May 18, 2021
@stephaniewang526 stephaniewang526 requested a review from shollyman May 18, 2021
@product-auto-label product-auto-label bot added the api: bigquery label May 18, 2021
@google-cla google-cla bot added the cla: yes label May 18, 2021
@stephaniewang526 stephaniewang526 requested a review from shollyman May 19, 2021
Copy link
Contributor

@shollyman shollyman left a comment

Looking much more complete this pass. A couple of minor followups for your consideration.

assertTrue(snapshotTable.getDefinition() instanceof SnapshotTableDefinition);
assertEquals(TABLE_SCHEMA, snapshotTable.getDefinition().getSchema());
assertNotNull(((SnapshotTableDefinition) snapshotTable.getDefinition()).getSnapshotTime());
assertEquals(
Copy link
Contributor

@shollyman shollyman May 20, 2021

Choose a reason for hiding this comment

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

Any reason you didn't just compare tableIds? Something with relative resolution of project?

Copy link
Member Author

@stephaniewang526 stephaniewang526 Jun 7, 2021

Choose a reason for hiding this comment

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

Yes, I would get this error if comparing tableIds:

java.lang.AssertionError: 
Expected :GenericData{classInfo=[datasetId, projectId, tableId], {datasetId=gcloud_test_dataset_temp_413a3914_e293_4da3_a3cd_e691ba96cdd1, tableId=test_copy_job_base_table}}
Actual   :GenericData{classInfo=[datasetId, projectId, tableId], {datasetId=gcloud_test_dataset_temp_413a3914_e293_4da3_a3cd_e691ba96cdd1, projectId=java-docs-samples-testing, tableId=test_copy_job_base_table}}

So I am comparing just the tableNames.

@stephaniewang526 stephaniewang526 added the do not merge label Jun 8, 2021
@stephaniewang526
Copy link
Member Author

@stephaniewang526 stephaniewang526 commented Jun 8, 2021

Will not merge until this feature is launched.

@stephaniewang526 stephaniewang526 removed the do not merge label Jun 28, 2021
@stephaniewang526 stephaniewang526 merged commit d783292 into googleapis:master Jun 28, 2021
18 checks passed
gcf-owl-bot bot added a commit that referenced this issue Jan 10, 2022
…-processor (#1320)

Source-Link: googleapis/synthtool@4b86ab0
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:efbfc5e9ff713005a037941f8ebcc0c69cc630e3ad934675ee26868705a30897
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants