From e3e6514bea627b15263043ec3d6f2ca17f1b9860 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 May 2022 18:23:47 +0200 Subject: [PATCH 01/13] test(deps): update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.0 (#2065) * test(deps): update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.0 * Update pom.xml Co-authored-by: Stephanie Wang --- pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 05a6ce473..a24605983 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.6.1 + 1.8.0 pom import @@ -104,7 +104,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.7.3 + 1.8.0 pom import @@ -293,3 +293,4 @@ + From 9d6b27e5614dd8e3b76bee2da04a1aff87d37ed3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 25 May 2022 16:28:11 +0000 Subject: [PATCH 02/13] chore(main): release 2.12.1-SNAPSHOT (#2068) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index b0d1afe97..656ff66fb 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.12.0 + 2.12.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 1736ade47..2d9981c2f 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.12.0 + 2.12.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.12.0 + 2.12.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a24605983..28628a5e7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.12.0 + 2.12.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.12.0 + 2.12.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a6c2f4398..680e99d81 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.12.0 + 2.12.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 026fbb39e..d251b42db 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.12.0:2.12.0 \ No newline at end of file +google-cloud-bigquery:2.12.0:2.12.1-SNAPSHOT \ No newline at end of file From d3d09a4e1c5f864c78c1db920e637b2b8c50cfaf Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Wed, 25 May 2022 14:08:14 -0400 Subject: [PATCH 03/13] chore: manage dependency updates from renovate-bot (#2069) to address issues like: image which occurs since shared-dependencies updates take different amount of time to roll out in various cloud clients. [Full trace](https://github.com/googleapis/java-bigquery/runs/6578164174?check_suite_focus=true) In this PR, we group the GCP Java client dependencies together so that their updates will be proposed in one single PR when they get updated: ``` "^com.google.cloud:google-cloud-datacatalog", "^com.google.cloud:google-cloud-bigquerystorage-bom", "^com.google.cloud:google-cloud-storage" ``` In addition, we classify `^com.google.cloud:google-cloud-bigtable` as a `chore` dependency update since it is only used in samples and it should not result in a client library version bump. --- README.md | 4 ++-- renovate.json | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0d2537d09..7d474f6c3 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.11.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.12.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.11.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.12.0" ``` ## Authentication diff --git a/renovate.json b/renovate.json index 2b19d40fd..cd5ba2793 100644 --- a/renovate.json +++ b/renovate.json @@ -39,6 +39,7 @@ { "packagePatterns": [ "^com.google.cloud:google-cloud-bigquery", + "^com.google.cloud:google-cloud-bigtable", "^com.google.cloud:libraries-bom", "^com.google.cloud.samples:shared-configuration" ], @@ -70,10 +71,11 @@ { "packagePatterns": [ "^com.google.api.grpc:proto-google-cloud-datacatalog", - "^com.google.cloud:google-cloud-datacatalog" + "^com.google.cloud:google-cloud-datacatalog", + "^com.google.cloud:google-cloud-bigquerystorage-bom", + "^com.google.cloud:google-cloud-storage" ], - "groupName": "datacatalog dependencies", - "semanticCommitType": "test", + "groupName": "cloud client dependencies", "semanticCommitScope": "deps" } ], From 621d357cc0ed195584f5b49f6f61032d007b2b6f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 May 2022 22:12:51 +0200 Subject: [PATCH 04/13] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.12.0 (#2071) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.12.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7d474f6c3..39d86d4d9 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.11.2 + 2.12.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 55cedc650..3f4a19322 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.11.2 + 2.12.0 From 4e153f525cc600cecdfabec600b166560ba62607 Mon Sep 17 00:00:00 2001 From: Ayush Walekar Date: Thu, 26 May 2022 20:16:12 +0530 Subject: [PATCH 05/13] docs(samples): update querypagination sample (#2074) - Updated example to loop through all remaining pages Changes for the open issue: https://github.com/googleapis/java-bigquery/issues/2073 --- .../java/com/example/bigquery/QueryPagination.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java b/samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java index dc9a6a24f..86915bab7 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java +++ b/samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java @@ -62,19 +62,11 @@ public static void queryPagination(String datasetName, String tableName, String .getValues() .forEach(row -> row.forEach(val -> System.out.printf("%s,\n", val.toString()))); - if (results.hasNextPage()) { - // Next Page - results - .getNextPage() - .getValues() - .forEach(row -> row.forEach(val -> System.out.printf("%s,\n", val.toString()))); - } - - if (results.hasNextPage()) { + while (results.hasNextPage()) { // Remaining Pages + results = results.getNextPage(); results - .getNextPage() - .iterateAll() + .getValues() .forEach(row -> row.forEach(val -> System.out.printf("%s,\n", val.toString()))); } From 51694d8e07f19a5203f613888a4dd1f907ddb382 Mon Sep 17 00:00:00 2001 From: Prashant Mishra <11733935+prash-mi@users.noreply.github.com> Date: Thu, 26 May 2022 21:01:34 +0530 Subject: [PATCH 06/13] chore: NPE in testConnectionClose (#2072) * Added a not null assertion for connection in testConnectionClose * Added testCreateDefaultConnection --- .../com/google/cloud/bigquery/it/ITBigQueryTest.java | 9 +++++++++ .../google/cloud/bigquery/it/ITNightlyBigQueryTest.java | 1 + 2 files changed, 10 insertions(+) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 5b2b74ec0..3ca11c0c6 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -2724,6 +2724,15 @@ public void testReadAPIIterationAndOrder() connection.close(); } + // Ref: https://github.com/googleapis/java-bigquery/issues/2070. Adding a pre-submit test to see + // if bigquery.createConnection() returns null + @Test + public void testCreateDefaultConnection() throws BigQuerySQLException { + Connection connection = bigquery.createConnection(); + assertNotNull("bigquery.createConnection() returned null", connection); + assertTrue(connection.close()); + } + @Test public void testReadAPIConnectionMultiClose() throws diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java index deabba59f..73bd21a30 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java @@ -341,6 +341,7 @@ public void testIterateAndOrderDefaultConnSettings() throws SQLException { @Test public void testConnectionClose() throws SQLException { Connection connection = bigquery.createConnection(); + assertNotNull("bigquery.createConnection() returned null", connection); BigQueryResult bigQueryResult = connection.executeSelect(QUERY); logger.log(Level.INFO, "Query used: {0}", QUERY); ResultSet rs = bigQueryResult.getResultSet(); From 38d6baefeebe0dc2858d38f6c44ad727b6beba92 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 26 May 2022 22:10:17 +0200 Subject: [PATCH 07/13] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.1 (#2076) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-datacatalog-bom](https://togithub.com/googleapis/java-datacatalog) | `1.8.0` -> `1.8.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.8.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.8.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.8.1/compatibility-slim/1.8.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.8.1/confidence-slim/1.8.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-datacatalog ### [`v1.8.1`](https://togithub.com/googleapis/java-datacatalog/blob/HEAD/CHANGELOG.md#​181-httpsgithubcomgoogleapisjava-datacatalogcomparev180v181-2022-05-26) [Compare Source](https://togithub.com/googleapis/java-datacatalog/compare/v1.8.0...v1.8.1)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- 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-bigquery). --- pom.xml | 4 ++-- renovate.json | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 28628a5e7..43f796114 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.8.0 + 1.8.1 pom import @@ -104,7 +104,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.8.0 + 1.8.1 pom import diff --git a/renovate.json b/renovate.json index cd5ba2793..56fe3f2ab 100644 --- a/renovate.json +++ b/renovate.json @@ -75,8 +75,7 @@ "^com.google.cloud:google-cloud-bigquerystorage-bom", "^com.google.cloud:google-cloud-storage" ], - "groupName": "cloud client dependencies", - "semanticCommitScope": "deps" + "groupName": "cloud client dependencies" } ], "semanticCommits": true, From eb443dfd5fd26e9c424dcbb1b00af5260a525679 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 27 May 2022 17:42:23 +0200 Subject: [PATCH 08/13] deps: update dependency com.google.cloud:google-cloud-storage to v2.7.2 (#2077) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](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.7.1` -> `2.7.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.7.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.7.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.7.2/compatibility-slim/2.7.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.7.2/confidence-slim/2.7.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-storage ### [`v2.7.2`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​272-httpsgithubcomgoogleapisjava-storagecomparev271v272-2022-05-27) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.7.1...v2.7.2)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- 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-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 43f796114..640b33aa1 100644 --- a/pom.xml +++ b/pom.xml @@ -176,7 +176,7 @@ com.google.cloud google-cloud-storage - 2.7.1 + 2.7.2 test From c6cb5643352aebf892d0f70e0b7d91e46703c759 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Tue, 31 May 2022 11:42:07 -0400 Subject: [PATCH 09/13] Revert "deps: update dependency org.assertj:assertj-core to v3 (#1786)" (#2081) This reverts commit 69fcabf478c6fab23c4da3fcc516f820cc178a5b. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 640b33aa1..eb2a82663 100644 --- a/pom.xml +++ b/pom.xml @@ -183,7 +183,7 @@ org.assertj assertj-core - 3.22.0 + 2.9.1 test From 7ec5c041ba405d89cb2c935faa513040dff7c673 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 31 May 2022 18:30:12 +0200 Subject: [PATCH 10/13] test(deps): update dependency org.mockito:mockito-core to v4.6.0 (#2078) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eb2a82663..11de361a7 100644 --- a/pom.xml +++ b/pom.xml @@ -170,7 +170,7 @@ org.mockito mockito-core - 4.5.1 + 4.6.0 test From 7f0901467037240499996a817be0b84d11b18c86 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 31 May 2022 20:09:19 +0200 Subject: [PATCH 11/13] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.8.0 (#2082) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3f4a19322..2f6508846 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.7.0 + 2.8.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 680e99d81..de3522f6b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.7.0 + 2.8.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 821f95718..cda562651 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.7.0 + 2.8.0 test From 9e0b35136aed6ed489bff4d4ac86c4d5d83274be Mon Sep 17 00:00:00 2001 From: Prashant Mishra <11733935+prash-mi@users.noreply.github.com> Date: Tue, 31 May 2022 23:39:56 +0530 Subject: [PATCH 12/13] feat: add destinationExpirationTime to CopyJobConfiguration (#2031) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add destinationExpirationTime * Added testDestExpTimeTableCopyJob IT * Added testDestExpTimeTableCopyJob IT * Removed testDestExpTimeTableCopyJob IT. Modified testCopyJobWithLabelsAndExpTime to add destinationExpiryTime * Modified Builder to add destinationExpiryTime * Modified testCopyJobWithLabelsAndExpTime. Added assertion for destinationExpiryTime * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../cloud/bigquery/CopyJobConfiguration.java | 28 +++++++++++++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 10 +++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java index 0b11bf7be..fe67986fc 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java @@ -39,6 +39,7 @@ public final class CopyJobConfiguration extends JobConfiguration { private final List sourceTables; private final TableId destinationTable; private final String operationType; + private final String destinationExpirationTime; private final JobInfo.CreateDisposition createDisposition; private final JobInfo.WriteDisposition writeDisposition; private final EncryptionConfiguration destinationEncryptionConfiguration; @@ -51,6 +52,7 @@ public static final class Builder private List sourceTables; private TableId destinationTable; private String operationType; + private String destinationExpirationTime; private JobInfo.CreateDisposition createDisposition; private JobInfo.WriteDisposition writeDisposition; private EncryptionConfiguration destinationEncryptionConfiguration; @@ -66,6 +68,7 @@ private Builder(CopyJobConfiguration jobConfiguration) { this.sourceTables = jobConfiguration.sourceTables; this.destinationTable = jobConfiguration.destinationTable; this.operationType = jobConfiguration.operationType; + this.destinationExpirationTime = jobConfiguration.destinationExpirationTime; this.createDisposition = jobConfiguration.createDisposition; this.writeDisposition = jobConfiguration.writeDisposition; this.destinationEncryptionConfiguration = jobConfiguration.destinationEncryptionConfiguration; @@ -80,6 +83,10 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur if (copyConfigurationPb.getOperationType() != null) { this.operationType = copyConfigurationPb.getOperationType(); } + if (copyConfigurationPb.getDestinationExpirationTime() != null) { + this.destinationExpirationTime = + copyConfigurationPb.getDestinationExpirationTime().toString(); + } if (copyConfigurationPb.getSourceTables() != null) { this.sourceTables = Lists.transform(copyConfigurationPb.getSourceTables(), TableId.FROM_PB_FUNCTION); @@ -129,6 +136,16 @@ public Builder setOperationType(String operationType) { return this; } + /** + * Sets the time when the destination table expires. Expired tables will be deleted and their + * storage reclaimed. More info: + * https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#jobconfigurationtablecopy + */ + public Builder setDestinationExpirationTime(String destinationExpirationTime) { + this.destinationExpirationTime = destinationExpirationTime; + return this; + } + public Builder setDestinationEncryptionConfiguration( EncryptionConfiguration encryptionConfiguration) { this.destinationEncryptionConfiguration = encryptionConfiguration; @@ -194,6 +211,7 @@ private CopyJobConfiguration(Builder builder) { this.sourceTables = checkNotNull(builder.sourceTables); this.destinationTable = checkNotNull(builder.destinationTable); this.operationType = builder.operationType; + this.destinationExpirationTime = builder.destinationExpirationTime; this.createDisposition = builder.createDisposition; this.writeDisposition = builder.writeDisposition; this.destinationEncryptionConfiguration = builder.destinationEncryptionConfiguration; @@ -216,6 +234,11 @@ public String getOperationType() { return operationType; } + /** Returns the time when the destination table expires */ + public String getDestinationExpirationTime() { + return destinationExpirationTime; + } + public EncryptionConfiguration getDestinationEncryptionConfiguration() { return destinationEncryptionConfiguration; } @@ -263,6 +286,7 @@ ToStringHelper toStringHelper() { .add("sourceTables", sourceTables) .add("destinationTable", destinationTable) .add("operationType", operationType) + .add("destinationExpirationTime", destinationExpirationTime) .add("destinationEncryptionConfiguration", destinationEncryptionConfiguration) .add("createDisposition", createDisposition) .add("writeDisposition", writeDisposition) @@ -283,6 +307,7 @@ public int hashCode() { sourceTables, destinationTable, operationType, + destinationExpirationTime, createDisposition, writeDisposition, labels, @@ -322,6 +347,9 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { if (operationType != null) { configurationPb.setOperationType(operationType); } + if (destinationExpirationTime != null) { + configurationPb.setDestinationExpirationTime(destinationExpirationTime); + } if (createDisposition != null) { configurationPb.setCreateDisposition(createDisposition.toString()); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 3ca11c0c6..812833d9c 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -3893,7 +3893,8 @@ public void testSnapshotTableCopyJob() throws InterruptedException { } @Test - public void testCopyJobWithLabels() throws InterruptedException { + public void testCopyJobWithLabelsAndExpTime() throws InterruptedException { + String destExpiryTime = "2025-12-31T23:59:59.999999999Z"; String sourceTableName = "test_copy_job_source_table_label"; String destinationTableName = "test_copy_job_destination_table_label"; Map labels = ImmutableMap.of("test_job_name", "test_copy_job"); @@ -3904,12 +3905,17 @@ public void testCopyJobWithLabels() throws InterruptedException { assertNotNull(createdTable); TableId destinationTable = TableId.of(DATASET, destinationTableName); CopyJobConfiguration configuration = - CopyJobConfiguration.newBuilder(destinationTable, sourceTable).setLabels(labels).build(); + CopyJobConfiguration.newBuilder(destinationTable, sourceTable) + .setLabels(labels) + .setDestinationExpirationTime(destExpiryTime) + .build(); Job remoteJob = bigquery.create(JobInfo.of(configuration)); remoteJob = remoteJob.waitFor(); assertNull(remoteJob.getStatus().getError()); CopyJobConfiguration copyJobConfiguration = remoteJob.getConfiguration(); assertEquals(labels, copyJobConfiguration.getLabels()); + assertNotNull(copyJobConfiguration.getDestinationExpirationTime()); + assertEquals(destExpiryTime, copyJobConfiguration.getDestinationExpirationTime()); Table remoteTable = bigquery.getTable(DATASET, destinationTableName); assertNotNull(remoteTable); assertTrue(createdTable.delete()); From 729e69e51385f2e6604c0c226f8b1839511642c9 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 31 May 2022 18:46:11 +0000 Subject: [PATCH 13/13] chore(main): release 2.13.0 (#2075) :robot: I have created a release *beep* *boop* --- ## [2.13.0](https://github.com/googleapis/java-bigquery/compare/v2.12.0...v2.13.0) (2022-05-31) ### Features * add destinationExpirationTime to CopyJobConfiguration ([#2031](https://github.com/googleapis/java-bigquery/issues/2031)) ([9e0b351](https://github.com/googleapis/java-bigquery/commit/9e0b35136aed6ed489bff4d4ac86c4d5d83274be)) ### Documentation * **samples:** update querypagination sample ([#2074](https://github.com/googleapis/java-bigquery/issues/2074)) ([4e153f5](https://github.com/googleapis/java-bigquery/commit/4e153f525cc600cecdfabec600b166560ba62607)) ### Dependencies * update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.1 ([#2076](https://github.com/googleapis/java-bigquery/issues/2076)) ([38d6bae](https://github.com/googleapis/java-bigquery/commit/38d6baefeebe0dc2858d38f6c44ad727b6beba92)) * update dependency com.google.cloud:google-cloud-storage to v2.7.2 ([#2077](https://github.com/googleapis/java-bigquery/issues/2077)) ([eb443df](https://github.com/googleapis/java-bigquery/commit/eb443dfd5fd26e9c424dcbb1b00af5260a525679)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 18 ++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56c529d65..849a6b119 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [2.13.0](https://github.com/googleapis/java-bigquery/compare/v2.12.0...v2.13.0) (2022-05-31) + + +### Features + +* add destinationExpirationTime to CopyJobConfiguration ([#2031](https://github.com/googleapis/java-bigquery/issues/2031)) ([9e0b351](https://github.com/googleapis/java-bigquery/commit/9e0b35136aed6ed489bff4d4ac86c4d5d83274be)) + + +### Documentation + +* **samples:** update querypagination sample ([#2074](https://github.com/googleapis/java-bigquery/issues/2074)) ([4e153f5](https://github.com/googleapis/java-bigquery/commit/4e153f525cc600cecdfabec600b166560ba62607)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.1 ([#2076](https://github.com/googleapis/java-bigquery/issues/2076)) ([38d6bae](https://github.com/googleapis/java-bigquery/commit/38d6baefeebe0dc2858d38f6c44ad727b6beba92)) +* update dependency com.google.cloud:google-cloud-storage to v2.7.2 ([#2077](https://github.com/googleapis/java-bigquery/issues/2077)) ([eb443df](https://github.com/googleapis/java-bigquery/commit/eb443dfd5fd26e9c424dcbb1b00af5260a525679)) + ## [2.12.0](https://github.com/googleapis/java-bigquery/compare/v2.11.2...v2.12.0) (2022-05-25) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 656ff66fb..93a03ee18 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.12.1-SNAPSHOT + 2.13.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 2d9981c2f..ac898f783 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.12.1-SNAPSHOT + 2.13.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.12.1-SNAPSHOT + 2.13.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 11de361a7..7a1b27941 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.12.1-SNAPSHOT + 2.13.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.12.1-SNAPSHOT + 2.13.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index de3522f6b..6b9ccabbb 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.12.1-SNAPSHOT + 2.13.0 diff --git a/versions.txt b/versions.txt index d251b42db..fca5ef218 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.12.0:2.12.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.13.0:2.13.0 \ No newline at end of file