From c00f865a248c166a00c4ba9c5fd63d82ff2ae32c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 17 Mar 2021 19:50:04 +0000 Subject: [PATCH 01/15] chore: release 1.15.2-SNAPSHOT (#945) :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). --- google-cloud-bigquerystorage-bom/pom.xml | 20 +++++++++---------- google-cloud-bigquerystorage/pom.xml | 4 ++-- grpc-google-cloud-bigquerystorage-v1/pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- pom.xml | 20 +++++++++---------- proto-google-cloud-bigquerystorage-v1/pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 18 ++++++++--------- 13 files changed, 48 insertions(+), 48 deletions(-) diff --git a/google-cloud-bigquerystorage-bom/pom.xml b/google-cloud-bigquerystorage-bom/pom.xml index d7bbca6cb9..d14df1e3ff 100644 --- a/google-cloud-bigquerystorage-bom/pom.xml +++ b/google-cloud-bigquerystorage-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquerystorage-bom - 1.15.1 + 1.15.2-SNAPSHOT pom com.google.cloud @@ -63,48 +63,48 @@ com.google.api.grpc proto-google-cloud-bigquerystorage-v1alpha2 - 0.115.1 + 0.115.2-SNAPSHOT com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta1 - 0.115.1 + 0.115.2-SNAPSHOT com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta2 - 0.115.1 + 0.115.2-SNAPSHOT com.google.api.grpc proto-google-cloud-bigquerystorage-v1 - 1.15.1 + 1.15.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigquerystorage-v1alpha2 - 0.115.1 + 0.115.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta1 - 0.115.1 + 0.115.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta2 - 0.115.1 + 0.115.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigquerystorage-v1 - 1.15.1 + 1.15.2-SNAPSHOT com.google.cloud google-cloud-bigquerystorage - 1.15.1 + 1.15.2-SNAPSHOT diff --git a/google-cloud-bigquerystorage/pom.xml b/google-cloud-bigquerystorage/pom.xml index 6c3fd2d953..50b5511b93 100644 --- a/google-cloud-bigquerystorage/pom.xml +++ b/google-cloud-bigquerystorage/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquerystorage - 1.15.1 + 1.15.2-SNAPSHOT jar BigQuery Storage https://github.com/googleapis/java-bigquerystorage @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquerystorage-parent - 1.15.1 + 1.15.2-SNAPSHOT google-cloud-bigquerystorage diff --git a/grpc-google-cloud-bigquerystorage-v1/pom.xml b/grpc-google-cloud-bigquerystorage-v1/pom.xml index 29f68ff272..1cd5a68dcf 100644 --- a/grpc-google-cloud-bigquerystorage-v1/pom.xml +++ b/grpc-google-cloud-bigquerystorage-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1 - 1.15.1 + 1.15.2-SNAPSHOT grpc-google-cloud-bigquerystorage-v1 GRPC library for grpc-google-cloud-bigquerystorage-v1 com.google.cloud google-cloud-bigquerystorage-parent - 1.15.1 + 1.15.2-SNAPSHOT diff --git a/grpc-google-cloud-bigquerystorage-v1alpha2/pom.xml b/grpc-google-cloud-bigquerystorage-v1alpha2/pom.xml index eb42e0ae41..e4a953af5e 100644 --- a/grpc-google-cloud-bigquerystorage-v1alpha2/pom.xml +++ b/grpc-google-cloud-bigquerystorage-v1alpha2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1alpha2 - 0.115.1 + 0.115.2-SNAPSHOT grpc-google-cloud-bigquerystorage-v1alpha2 GRPC library for grpc-google-cloud-bigquerystorage-v1alpha2 com.google.cloud google-cloud-bigquerystorage-parent - 1.15.1 + 1.15.2-SNAPSHOT diff --git a/grpc-google-cloud-bigquerystorage-v1beta1/pom.xml b/grpc-google-cloud-bigquerystorage-v1beta1/pom.xml index 118975f750..fb0a011cb9 100644 --- a/grpc-google-cloud-bigquerystorage-v1beta1/pom.xml +++ b/grpc-google-cloud-bigquerystorage-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta1 - 0.115.1 + 0.115.2-SNAPSHOT grpc-google-cloud-bigquerystorage-v1beta1 GRPC library for grpc-google-cloud-bigquerystorage-v1beta1 com.google.cloud google-cloud-bigquerystorage-parent - 1.15.1 + 1.15.2-SNAPSHOT diff --git a/grpc-google-cloud-bigquerystorage-v1beta2/pom.xml b/grpc-google-cloud-bigquerystorage-v1beta2/pom.xml index 266b2ca98c..0e7998b1f7 100644 --- a/grpc-google-cloud-bigquerystorage-v1beta2/pom.xml +++ b/grpc-google-cloud-bigquerystorage-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta2 - 0.115.1 + 0.115.2-SNAPSHOT grpc-google-cloud-bigquerystorage-v1beta2 GRPC library for grpc-google-cloud-bigquerystorage-v1beta2 com.google.cloud google-cloud-bigquerystorage-parent - 1.15.1 + 1.15.2-SNAPSHOT diff --git a/pom.xml b/pom.xml index 802a04ac65..163e3b2c8d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquerystorage-parent pom - 1.15.1 + 1.15.2-SNAPSHOT BigQuery Storage Parent https://github.com/googleapis/java-bigquerystorage @@ -101,47 +101,47 @@ com.google.api.grpc proto-google-cloud-bigquerystorage-v1alpha2 - 0.115.1 + 0.115.2-SNAPSHOT com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta1 - 0.115.1 + 0.115.2-SNAPSHOT com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta2 - 0.115.1 + 0.115.2-SNAPSHOT com.google.api.grpc proto-google-cloud-bigquerystorage-v1 - 1.15.1 + 1.15.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigquerystorage-v1alpha2 - 0.115.1 + 0.115.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta1 - 0.115.1 + 0.115.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta2 - 0.115.1 + 0.115.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigquerystorage-v1 - 1.15.1 + 1.15.2-SNAPSHOT com.google.cloud google-cloud-bigquerystorage - 1.15.1 + 1.15.2-SNAPSHOT org.json diff --git a/proto-google-cloud-bigquerystorage-v1/pom.xml b/proto-google-cloud-bigquerystorage-v1/pom.xml index 7ab0a1ef6d..65687963fb 100644 --- a/proto-google-cloud-bigquerystorage-v1/pom.xml +++ b/proto-google-cloud-bigquerystorage-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1 - 1.15.1 + 1.15.2-SNAPSHOT proto-google-cloud-bigquerystorage-v1 PROTO library for proto-google-cloud-bigquerystorage-v1 com.google.cloud google-cloud-bigquerystorage-parent - 1.15.1 + 1.15.2-SNAPSHOT diff --git a/proto-google-cloud-bigquerystorage-v1alpha2/pom.xml b/proto-google-cloud-bigquerystorage-v1alpha2/pom.xml index 28f1af25ca..e5222f0f5c 100644 --- a/proto-google-cloud-bigquerystorage-v1alpha2/pom.xml +++ b/proto-google-cloud-bigquerystorage-v1alpha2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1alpha2 - 0.115.1 + 0.115.2-SNAPSHOT proto-google-cloud-bigquerystorage-v1alpha2 PROTO library for proto-google-cloud-bigquerystorage-v1alpha2 com.google.cloud google-cloud-bigquerystorage-parent - 1.15.1 + 1.15.2-SNAPSHOT diff --git a/proto-google-cloud-bigquerystorage-v1beta1/pom.xml b/proto-google-cloud-bigquerystorage-v1beta1/pom.xml index dc6e8096d6..7766306ed5 100644 --- a/proto-google-cloud-bigquerystorage-v1beta1/pom.xml +++ b/proto-google-cloud-bigquerystorage-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta1 - 0.115.1 + 0.115.2-SNAPSHOT proto-google-cloud-bigquerystorage-v1beta1 PROTO library for proto-google-cloud-bigquerystorage-v1beta1 com.google.cloud google-cloud-bigquerystorage-parent - 1.15.1 + 1.15.2-SNAPSHOT diff --git a/proto-google-cloud-bigquerystorage-v1beta2/pom.xml b/proto-google-cloud-bigquerystorage-v1beta2/pom.xml index 697b71ce40..5a51b95d84 100644 --- a/proto-google-cloud-bigquerystorage-v1beta2/pom.xml +++ b/proto-google-cloud-bigquerystorage-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta2 - 0.115.1 + 0.115.2-SNAPSHOT proto-google-cloud-bigquerystorage-v1beta2 PROTO library for proto-google-cloud-bigquerystorage-v1beta2 com.google.cloud google-cloud-bigquerystorage-parent - 1.15.1 + 1.15.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9ac10ccaaf..bf5418d1dd 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-bigquerystorage - 1.15.1 + 1.15.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 9fcb9c5c89..83ed0e68c0 100644 --- a/versions.txt +++ b/versions.txt @@ -1,12 +1,12 @@ # Format: # module:released-version:current-version -proto-google-cloud-bigquerystorage-v1alpha2:0.115.1:0.115.1 -proto-google-cloud-bigquerystorage-v1beta1:0.115.1:0.115.1 -proto-google-cloud-bigquerystorage-v1beta2:0.115.1:0.115.1 -proto-google-cloud-bigquerystorage-v1:1.15.1:1.15.1 -grpc-google-cloud-bigquerystorage-v1alpha2:0.115.1:0.115.1 -grpc-google-cloud-bigquerystorage-v1beta1:0.115.1:0.115.1 -grpc-google-cloud-bigquerystorage-v1beta2:0.115.1:0.115.1 -grpc-google-cloud-bigquerystorage-v1:1.15.1:1.15.1 -google-cloud-bigquerystorage:1.15.1:1.15.1 +proto-google-cloud-bigquerystorage-v1alpha2:0.115.1:0.115.2-SNAPSHOT +proto-google-cloud-bigquerystorage-v1beta1:0.115.1:0.115.2-SNAPSHOT +proto-google-cloud-bigquerystorage-v1beta2:0.115.1:0.115.2-SNAPSHOT +proto-google-cloud-bigquerystorage-v1:1.15.1:1.15.2-SNAPSHOT +grpc-google-cloud-bigquerystorage-v1alpha2:0.115.1:0.115.2-SNAPSHOT +grpc-google-cloud-bigquerystorage-v1beta1:0.115.1:0.115.2-SNAPSHOT +grpc-google-cloud-bigquerystorage-v1beta2:0.115.1:0.115.2-SNAPSHOT +grpc-google-cloud-bigquerystorage-v1:1.15.1:1.15.2-SNAPSHOT +google-cloud-bigquerystorage:1.15.1:1.15.2-SNAPSHOT From 33be92e978ed847d0b25efa66acf69a5e35103e9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 18 Mar 2021 23:32:46 +0100 Subject: [PATCH 02/15] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage to v1.15.1 (#946) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d9f99df807..1fbbbfef50 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -30,7 +30,7 @@ com.google.cloud google-cloud-bigquerystorage - 1.15.0 + 1.15.1 From bcdb2b773acdb7238b0cacf01c8238ce5939f485 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 18 Mar 2021 23:33:08 +0100 Subject: [PATCH 03/15] chore(deps): update dependency com.google.cloud:libraries-bom to v19.2.0 (#948) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 61f7af6db2..effd9b9511 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -31,7 +31,7 @@ com.google.cloud libraries-bom - 19.1.0 + 19.2.0 pom import From d781dc5479602fee01eb971033978317e5669694 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 18 Mar 2021 23:36:31 +0100 Subject: [PATCH 04/15] deps: update dependency com.google.cloud:google-cloud-bigquery to v1.127.9 (#947) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 163e3b2c8d..ecd8710d69 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-bigquery - 1.127.8 + 1.127.9 com.google.api.grpc From 969b4290b9934b94b1a0113e04e37ff44b2a536e Mon Sep 17 00:00:00 2001 From: JacobStocklass <35313153+JacobStocklass@users.noreply.github.com> Date: Thu, 18 Mar 2021 22:37:55 +0000 Subject: [PATCH 05/15] feat: Add CivilTimeEncoder to encode and decode DateTime/Time as numerics (#937) * Adding Time Encoding Integration Test Placeholder * Removing Stress test from this branch and moving it to the appropriate branch * Add integration test to make sure that encoding and decoding across a table insertion holds up * Added Integration test, renamed functions and got rid of redundant functions * Fix License Header * Java Lang set to 8 in order to use Java Local Time * Removing nano functions, cleaning up comments * Added round trip test to unit tests * Moving to threeten time instead of java time * Removing Java Time Dependency * Lint * Adding Time Encoding Integration Test Placeholder * Removing Stress test from this branch and moving it to the appropriate branch * Add integration test to make sure that encoding and decoding across a table insertion holds up * Added Integration test, renamed functions and got rid of redundant functions * Fix License Header * Java Lang set to 8 in order to use Java Local Time * Removing nano functions, cleaning up comments * Added round trip test to unit tests * Moving to threeten time instead of java time * Removing Java Time Dependency * Lint * Remove E2E test for another PR. Split Unit tests into better named tests * Lint * Combining Encode and Decode Test for easier reading * Removing unused methods --- .../storage/v1beta2/CivilTimeEncoder.java | 314 ++++++++++++++++ .../storage/v1beta2/CivilTimeEncoderTest.java | 334 ++++++++++++++++++ 2 files changed, 648 insertions(+) create mode 100644 google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/CivilTimeEncoder.java create mode 100644 google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/CivilTimeEncoderTest.java diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/CivilTimeEncoder.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/CivilTimeEncoder.java new file mode 100644 index 0000000000..1ab8d9eb17 --- /dev/null +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/CivilTimeEncoder.java @@ -0,0 +1,314 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigquery.storage.v1beta2; + +import static com.google.common.base.Preconditions.checkArgument; + +import org.threeten.bp.DateTimeException; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.LocalTime; +import org.threeten.bp.temporal.ChronoUnit; + +/** + * Ported from ZetaSQL CivilTimeEncoder Original code can be found at: + * https://github.com/google/zetasql/blob/master/java/com/google/zetasql/CivilTimeEncoder.java + * Encoder for TIME and DATETIME values, according to civil_time encoding. + * + *

The valid range and number of bits required by each date/time field is as the following: + * + * + * + * + * + * + * + * + * + * + * + *
Field Range #Bits
Year [1, 9999] 14
Month [1, 12] 4
Day [1, 31] 5
Hour [0, 23] 5
Minute [0, 59] 6
Second [0, 59]* 6
Micros [0, 999999] 20
Nanos [0, 999999999] 30
+ * + *

* Leap second is not supported. + * + *

When encoding the TIME or DATETIME into a bit field, larger date/time field is on the more + * significant side. + */ +public final class CivilTimeEncoder { + private static final int NANO_LENGTH = 30; + private static final int MICRO_LENGTH = 20; + + private static final int NANO_SHIFT = 0; + private static final int MICRO_SHIFT = 0; + private static final int SECOND_SHIFT = 0; + private static final int MINUTE_SHIFT = 6; + private static final int HOUR_SHIFT = 12; + private static final int DAY_SHIFT = 17; + private static final int MONTH_SHIFT = 22; + private static final int YEAR_SHIFT = 26; + + private static final long NANO_MASK = 0x3FFFFFFFL; + private static final long MICRO_MASK = 0xFFFFFL; + private static final long SECOND_MASK = 0x3FL; + private static final long MINUTE_MASK = 0xFC0L; + private static final long HOUR_MASK = 0x1F000L; + private static final long DAY_MASK = 0x3E0000L; + private static final long MONTH_MASK = 0x3C00000L; + private static final long YEAR_MASK = 0xFFFC000000L; + + private static final long TIME_SECONDS_MASK = 0x1FFFFL; + private static final long TIME_MICROS_MASK = 0x1FFFFFFFFFL; + private static final long TIME_NANOS_MASK = 0x7FFFFFFFFFFFL; + private static final long DATETIME_SECONDS_MASK = 0xFFFFFFFFFFL; + private static final long DATETIME_MICROS_MASK = 0xFFFFFFFFFFFFFFFL; + + /** + * Encodes {@code time} as a 4-byte integer with seconds precision. + * + *

Encoding is as the following: + * + *

+   *      3         2         1
+   * MSB 10987654321098765432109876543210 LSB
+   *                    | H ||  M ||  S |
+   * 
+ * + * @see #decodePacked32TimeSeconds(int) + */ + @SuppressWarnings("GoodTime-ApiWithNumericTimeUnit") + private static int encodePacked32TimeSeconds(LocalTime time) { + checkValidTimeSeconds(time); + int bitFieldTimeSeconds = 0x0; + bitFieldTimeSeconds |= time.getHour() << HOUR_SHIFT; + bitFieldTimeSeconds |= time.getMinute() << MINUTE_SHIFT; + bitFieldTimeSeconds |= time.getSecond() << SECOND_SHIFT; + return bitFieldTimeSeconds; + } + + /** + * Decodes {@code bitFieldTimeSeconds} as a {@link LocalTime} with seconds precision. + * + *

Encoding is as the following: + * + *

+   *      3         2         1
+   * MSB 10987654321098765432109876543210 LSB
+   *                    | H ||  M ||  S |
+   * 
+ * + * @see #encodePacked32TimeSeconds(LocalTime) + */ + @SuppressWarnings("GoodTime-ApiWithNumericTimeUnit") + private static LocalTime decodePacked32TimeSeconds(int bitFieldTimeSeconds) { + checkValidBitField(bitFieldTimeSeconds, TIME_SECONDS_MASK); + int hourOfDay = getFieldFromBitField(bitFieldTimeSeconds, HOUR_MASK, HOUR_SHIFT); + int minuteOfHour = getFieldFromBitField(bitFieldTimeSeconds, MINUTE_MASK, MINUTE_SHIFT); + int secondOfMinute = getFieldFromBitField(bitFieldTimeSeconds, SECOND_MASK, SECOND_SHIFT); + // LocalTime validates the input parameters. + try { + return LocalTime.of(hourOfDay, minuteOfHour, secondOfMinute); + } catch (DateTimeException e) { + throw new IllegalArgumentException(e.getMessage(), e); + } + } + + /** + * Encodes {@code time} as a 8-byte integer with microseconds precision. + * + *

Encoding is as the following: + * + *

+   *        6         5         4         3         2         1
+   * MSB 3210987654321098765432109876543210987654321098765432109876543210 LSB
+   *                                | H ||  M ||  S ||-------micros-----|
+   * 
+ * + * @see #decodePacked64TimeMicros(long) + * @see #encodePacked64TimeMicros(LocalTime) + */ + @SuppressWarnings("GoodTime") + public static long encodePacked64TimeMicros(LocalTime time) { + checkValidTimeMicros(time); + return (((long) encodePacked32TimeSeconds(time)) << MICRO_LENGTH) | (time.getNano() / 1_000L); + } + + /** + * Decodes {@code bitFieldTimeMicros} as a {@link LocalTime} with microseconds precision. + * + *

Encoding is as the following: + * + *

+   *        6         5         4         3         2         1
+   * MSB 3210987654321098765432109876543210987654321098765432109876543210 LSB
+   *                                | H ||  M ||  S ||-------micros-----|
+   * 
+ * + * @see #encodePacked64TimeMicros(LocalTime) + */ + @SuppressWarnings("GoodTime-ApiWithNumericTimeUnit") + public static LocalTime decodePacked64TimeMicros(long bitFieldTimeMicros) { + checkValidBitField(bitFieldTimeMicros, TIME_MICROS_MASK); + int bitFieldTimeSeconds = (int) (bitFieldTimeMicros >> MICRO_LENGTH); + LocalTime timeSeconds = decodePacked32TimeSeconds(bitFieldTimeSeconds); + int microOfSecond = getFieldFromBitField(bitFieldTimeMicros, MICRO_MASK, MICRO_SHIFT); + checkValidMicroOfSecond(microOfSecond); + LocalTime time = timeSeconds.withNano(microOfSecond * 1000); + checkValidTimeMicros(time); + return time; + } + + /** + * Encodes {@code dateTime} as a 8-byte integer with seconds precision. + * + *

Encoding is as the following: + * + *

+   *        6         5         4         3         2         1
+   * MSB 3210987654321098765432109876543210987654321098765432109876543210 LSB
+   *                             |--- year ---||m || D || H ||  M ||  S |
+   * 
+ * + * @see #decodePacked64DatetimeSeconds(long) + */ + @SuppressWarnings("GoodTime-ApiWithNumericTimeUnit") + private static long encodePacked64DatetimeSeconds(LocalDateTime dateTime) { + checkValidDateTimeSeconds(dateTime); + long bitFieldDatetimeSeconds = 0x0L; + bitFieldDatetimeSeconds |= (long) dateTime.getYear() << YEAR_SHIFT; + bitFieldDatetimeSeconds |= (long) dateTime.getMonthValue() << MONTH_SHIFT; + bitFieldDatetimeSeconds |= (long) dateTime.getDayOfMonth() << DAY_SHIFT; + bitFieldDatetimeSeconds |= (long) encodePacked32TimeSeconds(dateTime.toLocalTime()); + return bitFieldDatetimeSeconds; + } + + /** + * Decodes {@code bitFieldDatetimeSeconds} as a {@link LocalDateTime} with seconds precision. + * + *

Encoding is as the following: + * + *

+   *        6         5         4         3         2         1
+   * MSB 3210987654321098765432109876543210987654321098765432109876543210 LSBa
+   *                             |--- year ---||m || D || H ||  M ||  S |
+   * 
+ * + * @see #encodePacked64DatetimeSeconds(LocalDateTime) + */ + @SuppressWarnings("GoodTime-ApiWithNumericTimeUnit") + private static LocalDateTime decodePacked64DatetimeSeconds(long bitFieldDatetimeSeconds) { + checkValidBitField(bitFieldDatetimeSeconds, DATETIME_SECONDS_MASK); + int bitFieldTimeSeconds = (int) (bitFieldDatetimeSeconds & TIME_SECONDS_MASK); + LocalTime timeSeconds = decodePacked32TimeSeconds(bitFieldTimeSeconds); + int year = getFieldFromBitField(bitFieldDatetimeSeconds, YEAR_MASK, YEAR_SHIFT); + int monthOfYear = getFieldFromBitField(bitFieldDatetimeSeconds, MONTH_MASK, MONTH_SHIFT); + int dayOfMonth = getFieldFromBitField(bitFieldDatetimeSeconds, DAY_MASK, DAY_SHIFT); + try { + LocalDateTime dateTime = + LocalDateTime.of( + year, + monthOfYear, + dayOfMonth, + timeSeconds.getHour(), + timeSeconds.getMinute(), + timeSeconds.getSecond()); + checkValidDateTimeSeconds(dateTime); + return dateTime; + } catch (DateTimeException e) { + throw new IllegalArgumentException(e.getMessage(), e); + } + } + + /** + * Encodes {@code dateTime} as a 8-byte integer with microseconds precision. + * + *

Encoding is as the following: + * + *

+   *        6         5         4         3         2         1
+   * MSB 3210987654321098765432109876543210987654321098765432109876543210 LSB
+   *         |--- year ---||m || D || H ||  M ||  S ||-------micros-----|
+   * 
+ * + * @see #decodePacked64DatetimeMicros(long) + */ + @SuppressWarnings({"GoodTime-ApiWithNumericTimeUnit", "JavaLocalDateTimeGetNano"}) + public static long encodePacked64DatetimeMicros(LocalDateTime dateTime) { + checkValidDateTimeMicros(dateTime); + return (encodePacked64DatetimeSeconds(dateTime) << MICRO_LENGTH) + | (dateTime.getNano() / 1_000L); + } + + /** + * Decodes {@code bitFieldDatetimeMicros} as a {@link LocalDateTime} with microseconds precision. + * + *

Encoding is as the following: + * + *

+   *        6         5         4         3         2         1
+   * MSB 3210987654321098765432109876543210987654321098765432109876543210 LSB
+   *         |--- year ---||m || D || H ||  M ||  S ||-------micros-----|
+   * 
+ * + * @see #encodePacked64DatetimeMicros(LocalDateTime) + */ + @SuppressWarnings("GoodTime-ApiWithNumericTimeUnit") + public static LocalDateTime decodePacked64DatetimeMicros(long bitFieldDatetimeMicros) { + checkValidBitField(bitFieldDatetimeMicros, DATETIME_MICROS_MASK); + long bitFieldDatetimeSeconds = bitFieldDatetimeMicros >> MICRO_LENGTH; + LocalDateTime dateTimeSeconds = decodePacked64DatetimeSeconds(bitFieldDatetimeSeconds); + int microOfSecond = getFieldFromBitField(bitFieldDatetimeMicros, MICRO_MASK, MICRO_SHIFT); + checkValidMicroOfSecond(microOfSecond); + LocalDateTime dateTime = dateTimeSeconds.withNano(microOfSecond * 1_000); + checkValidDateTimeMicros(dateTime); + return dateTime; + } + + private static int getFieldFromBitField(long bitField, long mask, int shift) { + return (int) ((bitField & mask) >> shift); + } + + private static void checkValidTimeSeconds(LocalTime time) { + checkArgument(time.getHour() >= 0 && time.getHour() <= 23); + checkArgument(time.getMinute() >= 0 && time.getMinute() <= 59); + checkArgument(time.getSecond() >= 0 && time.getSecond() <= 59); + } + + private static void checkValidDateTimeSeconds(LocalDateTime dateTime) { + checkArgument(dateTime.getYear() >= 1 && dateTime.getYear() <= 9999); + checkArgument(dateTime.getMonthValue() >= 1 && dateTime.getMonthValue() <= 12); + checkArgument(dateTime.getDayOfMonth() >= 1 && dateTime.getDayOfMonth() <= 31); + checkValidTimeSeconds(dateTime.toLocalTime()); + } + + private static void checkValidTimeMicros(LocalTime time) { + checkValidTimeSeconds(time); + checkArgument(time.equals(time.truncatedTo(ChronoUnit.MICROS))); + } + + private static void checkValidDateTimeMicros(LocalDateTime dateTime) { + checkValidDateTimeSeconds(dateTime); + checkArgument(dateTime.equals(dateTime.truncatedTo(ChronoUnit.MICROS))); + } + + private static void checkValidMicroOfSecond(int microOfSecond) { + checkArgument(microOfSecond >= 0 && microOfSecond <= 999999); + } + + private static void checkValidBitField(long bitField, long mask) { + checkArgument((bitField & ~mask) == 0x0L); + } + + private CivilTimeEncoder() {} +} diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/CivilTimeEncoderTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/CivilTimeEncoderTest.java new file mode 100644 index 0000000000..5711a05617 --- /dev/null +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/CivilTimeEncoderTest.java @@ -0,0 +1,334 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.storage.v1beta2; + +import static org.junit.Assert.assertEquals; + +import java.util.logging.Logger; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.LocalTime; + +@RunWith(JUnit4.class) +public class CivilTimeEncoderTest { + private static final Logger LOG = Logger.getLogger(CivilTimeEncoderTest.class.getName()); + + // Time + @Test + public void encodeAndDecodePacked64TimeMicros_validTime() { + // 00:00:00.000000 + // 0b000000000000000000000000000|00000|000000|000000|00000000000000000000 + // 0x0 + assertEquals(0x0L, CivilTimeEncoder.encodePacked64TimeMicros(LocalTime.of(0, 0, 0, 0))); + assertEquals(LocalTime.of(0, 0, 0, 0), CivilTimeEncoder.decodePacked64TimeMicros(0x0L)); + + // 00:01:02.003000 + // 0b000000000000000000000000000|00000|000001|000010|00000000101110111000 + // 0x4200BB8 + assertEquals( + 0x4200BB8L, CivilTimeEncoder.encodePacked64TimeMicros(LocalTime.of(0, 1, 2, 3_000_000))); + assertEquals( + LocalTime.of(0, 1, 2, 3_000_000), CivilTimeEncoder.decodePacked64TimeMicros(0x4200BB8L)); + + // 12:00:00.000000 + // 0b000000000000000000000000000|01100|000000|000000|00000000000000000000 + // 0xC00000000 + assertEquals( + 0xC00000000L, CivilTimeEncoder.encodePacked64TimeMicros(LocalTime.of(12, 0, 0, 0))); + assertEquals( + LocalTime.of(12, 0, 0, 0), CivilTimeEncoder.decodePacked64TimeMicros(0xC00000000L)); + + // 13:14:15.016000 + // 0b000000000000000000000000000|01101|001110|001111|00000011111010000000 + // 0xD38F03E80 + assertEquals( + 0xD38F03E80L, + CivilTimeEncoder.encodePacked64TimeMicros(LocalTime.of(13, 14, 15, 16_000_000))); + assertEquals( + LocalTime.of(13, 14, 15, 16_000_000), + CivilTimeEncoder.decodePacked64TimeMicros(0xD38F03E80L)); + + // 23:59:59.999000 + // 0b000000000000000000000000000|10111|111011|111011|11110011111001011000 + // 0x17EFBF3E58 + assertEquals( + 0x17EFBF3E58L, + CivilTimeEncoder.encodePacked64TimeMicros(LocalTime.of(23, 59, 59, 999_000_000))); + assertEquals( + LocalTime.of(23, 59, 59, 999_000_000), + CivilTimeEncoder.decodePacked64TimeMicros(0x17EFBF3E58L)); + } + + @Test + public void encodePacked64TimeMicros_giveErrorWhenPrecisionIsLost() { + try { // 00:00:00.000000999 + // 0b000000000000000000000000000|00000|000000|000000|00000000000000000000 + // 0x0 + assertEquals(0x0L, CivilTimeEncoder.encodePacked64TimeMicros(LocalTime.of(0, 0, 0, 999))); + Assert.fail(); + } catch (IllegalArgumentException e) { + } + } + + @Test + public void decodePacked64TimeMicros_invalidBitField_throwsIllegalArgumentException() { + try { + // 00:00:00.000000 + // 0b000000000000000000000000001|00000|000000|000000|00000000000000000000 + // 0x2000000000 + CivilTimeEncoder.decodePacked64TimeMicros(0x2000000000L); + Assert.fail(); + } catch (IllegalArgumentException e) { + assertEquals(null, e.getMessage()); + } + } + + @Test + public void decodePacked64TimeMicros_invalidMicroOfSecond_throwsIllegalArgumentException() { + try { + // 00:00:00.1000000 + // 0b000000000000000000000000000|00000|000000|000000|11110100001001000000 + // 0xF4240 + CivilTimeEncoder.decodePacked64TimeMicros(0xF4240L); + Assert.fail(); + } catch (IllegalArgumentException e) { + assertEquals(null, e.getMessage()); + } + } + + @Test + public void decodePacked64TimeMicros_invalidSecondOfMinute_throwsIllegalArgumentException() { + try { + // 00:00:60.000000 + // 0b000000000000000000000000000|00000|000000|111100|00000000000000000000 + // 0x3C00000 + CivilTimeEncoder.decodePacked64TimeMicros(0x3C00000L); + Assert.fail(); + } catch (IllegalArgumentException e) { + assertEquals("Invalid value for SecondOfMinute (valid values 0 - 59): 60", e.getMessage()); + } + } + + @Test + public void decodePacked64TimeMicros_invalidMinuteOfHour_throwsIllegalArgumentException() { + try { + // 00:60:00.000000 + // 0b000000000000000000000000000|00000|111100|000000|00000000000000000000 + // 0xF0000000 + CivilTimeEncoder.decodePacked64TimeMicros(0xF0000000L); + Assert.fail(); + } catch (IllegalArgumentException expected) { + } + } + + @Test + public void decodePacked64TimeMicros_invalidHourOfDay_throwsIllegalArgumentException() { + try { + // 24:00:00.000000 + // 0b000000000000000000000000000|11000|000000|000000|00000000000000000000 + // 0x1800000000 + CivilTimeEncoder.decodePacked64TimeMicros(0x1800000000L); + Assert.fail(); + } catch (IllegalArgumentException e) { + assertEquals("Invalid value for HourOfDay (valid values 0 - 23): 24", e.getMessage()); + } + } + + // Date Time + @Test + public void encodeAndDecodePacked64DatetimeMicros_validDateTime() { + // 0001/01/01 00:00:00 + // 0b0000000000000000000000|00000000000001|0001|00001|00000|000000|000000 + // 0x4420000 + assertEquals( + 0x442000000000L, + CivilTimeEncoder.encodePacked64DatetimeMicros(LocalDateTime.of(1, 1, 1, 0, 0, 0, 0))); + assertEquals( + LocalDateTime.of(1, 1, 1, 0, 0, 0, 0), + CivilTimeEncoder.decodePacked64DatetimeMicros(0x442000000000L)); + + // 0001/02/03 00:01:02 + // 0b0000000000000000000000|00000000000001|0010|00011|00000|000001|000010 + // 0x4860042 + assertEquals( + 0x486004200BB8L, + CivilTimeEncoder.encodePacked64DatetimeMicros( + LocalDateTime.of(1, 2, 3, 0, 1, 2, 3_000_000))); + assertEquals( + LocalDateTime.of(1, 2, 3, 0, 1, 2, 3_000_000), + CivilTimeEncoder.decodePacked64DatetimeMicros(0x486004200BB8L)); + + // 0001/01/01 12:00:00 + // 0b0000000000000000000000|00000000000001|0001|00001|01100|000000|000000 + // 0x442C000 + assertEquals( + 0x442C00000000L, + CivilTimeEncoder.encodePacked64DatetimeMicros(LocalDateTime.of(1, 1, 1, 12, 0, 0, 0))); + assertEquals( + LocalDateTime.of(1, 1, 1, 12, 0, 0, 0), + CivilTimeEncoder.decodePacked64DatetimeMicros(0x442C00000000L)); + + // 0001/01/01 13:14:15 + // 0b0000000000000000000000|00000000000001|0001|00001|01101|001110|001111 + // 0x442D38F + assertEquals( + 0x442D38F03E80L, + CivilTimeEncoder.encodePacked64DatetimeMicros( + LocalDateTime.of(1, 1, 1, 13, 14, 15, 16_000_000))); + assertEquals( + LocalDateTime.of(1, 1, 1, 13, 14, 15, 16_000_000), + CivilTimeEncoder.decodePacked64DatetimeMicros(0x442D38F03E80L)); + + // 9999/12/31 23:59:59 + // 0b0000000000000000000000|10011100001111|1100|11111|10111|111011|111011 + // 0x9C3F3F7EFB + assertEquals( + 0x9C3F3F7EFBF3E58L, + CivilTimeEncoder.encodePacked64DatetimeMicros( + LocalDateTime.of(9999, 12, 31, 23, 59, 59, 999_000_000))); + assertEquals( + LocalDateTime.of(9999, 12, 31, 23, 59, 59, 999_000_000), + CivilTimeEncoder.decodePacked64DatetimeMicros(0x9C3F3F7EFBF3E58L)); + } + + @Test + public void encodePacked64DateTimeMicros_giveErrorWhenPrecisionIsLost() { + // 0001/01/01 00:00:00.000000999 + // 0b0000000000000000000000|00000000000001|0001|00001|00000|000000|000000 + // 0x4420000 + try { + CivilTimeEncoder.encodePacked64DatetimeMicros(LocalDateTime.of(1, 1, 1, 0, 0, 0, 999)); + Assert.fail(); + } catch (IllegalArgumentException e) { + } + } + + @Test + public void encodePacked64DatetimeMicros_invalidYear_throwsIllegalArgumentException() { + // 10000/01/01 00:00:00.000000 + // 0b00|10011100010000|0001|00001|00000|000000|000000|00000000000000000000 + // 0x9C4042000000000 + LocalDateTime dateTime = LocalDateTime.of(10000, 1, 1, 0, 0, 0, 0); + try { + CivilTimeEncoder.encodePacked64DatetimeMicros(dateTime); + Assert.fail(); + } catch (IllegalArgumentException expected) { + } + } + + @Test + public void decodePacked64DatetimeMicros_validBitFieldDatetimeMicros() {} + + @Test + public void decodePacked64DatetimeMicros_invalidBitField() { + try { + // 0001/01/01 00:00:00 + // 0b0000000000000000000001|00000000000001|0001|00001|00000|000000|000000 + // 0x10004420000 + CivilTimeEncoder.decodePacked64DatetimeMicros(0x10004420000L); + Assert.fail(); + } catch (IllegalArgumentException e) { + } + } + + @Test + public void decodePacked64DatetimeMicros_invalidMicroOfSecond_throwsIllegalArgumentException() { + try { + // 0001/01/01 00:00:00.1000000 + // 0b00|00000000000001|0001|00001|00000|000000|000000|11110100001001000000 + // 0x4420000F4240 + CivilTimeEncoder.decodePacked64DatetimeMicros(0x4420000F4240L); + Assert.fail(); + } catch (IllegalArgumentException expected) { + } + } + + @Test + public void decodePacked64DatetimeMicros_invalidSecondOfMinute_throwsIllegalArgumentException() { + try { + // 0001/01/01 00:00:60.000000 + // 0b00|00000000000001|0001|00001|00000|000000|111100|00000000000000000000 + // 0x442003C00000 + CivilTimeEncoder.decodePacked64DatetimeMicros(0x442003C00000L); + Assert.fail(); + } catch (IllegalArgumentException expected) { + } + } + + @Test + public void decodePacked64DatetimeMicros_invalidMinuteOfHour_throwsIllegalArgumentException() { + try { + // 0001/01/01 00:60:00.000000 + // 0b00|00000000000001|0001|00001|00000|111100|000000|00000000000000000000 + // 0x4420F0000000 + CivilTimeEncoder.decodePacked64DatetimeMicros(0x4420F0000000L); + Assert.fail(); + } catch (IllegalArgumentException expected) { + } + } + + @Test + public void decodePacked64DatetimeMicros_invalidHourOfDay_throwsIllegalArgumentException() { + try { + // 0001/01/01 24:00:00.000000 + // 0b00|00000000000001|0001|00001|11000|000000|000000|00000000000000000000 + // 0x443800000000 + CivilTimeEncoder.decodePacked64DatetimeMicros(0x443800000000L); + Assert.fail(); + } catch (IllegalArgumentException expected) { + } + } + + @Test + public void decodePacked64DatetimeMicros_invalidDayOfMonth_throwsIllegalArgumentException() { + try { + // 0001/01/00 00:00:00.000000 + // 0b00|00000000000001|0001|00000|00000|000000|000000|00000000000000000000 + // 0x440000000000 + CivilTimeEncoder.decodePacked64DatetimeMicros(0x440000000000L); + Assert.fail(); + } catch (IllegalArgumentException expected) { + } + } + + @Test + public void decodePacked64DatetimeMicros_invalidMonthOfYear_throwsIllegalArgumentException() { + try { + // 0001/13/01 00:00:00.000000 + // 0b00|00000000000001|1101|00001|00000|000000|000000|00000000000000000000 + // 0x742000000000 + CivilTimeEncoder.decodePacked64DatetimeMicros(0x742000000000L); + Assert.fail(); + } catch (IllegalArgumentException expected) { + } + } + + @Test + public void decodePacked64DatetimeMicros_invalidYear_throwsIllegalArgumentException() { + try { + // 10000/01/01 00:00:00.000000 + // 0b00|10011100010000|0001|00001|00000|000000|000000|00000000000000000000 + // 0x9C4042000000000 + CivilTimeEncoder.decodePacked64DatetimeMicros(0x9C4042000000000L); + Assert.fail(); + } catch (IllegalArgumentException expected) { + } + } +} From 3835c8083b912a13d4ff4d7d08adca5e98c6ae99 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 18 Mar 2021 15:42:23 -0700 Subject: [PATCH 06/15] chore: regenerate README (#944) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 92ccccdd6e..0204d77b54 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquerystorage.git", - "sha": "cf0a42923b4f1e0550bc084d7467f59c2546b5fc" + "sha": "1554247cf55aa56281a530c721ab1650699a3efc" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "0b064d767537e0675fc053e53fca473c5c701fb8" + "sha": "78437c732a60c64895778697b078497b0988346c" } } ] diff --git a/README.md b/README.md index 926d18cce9..0a37147361 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 19.0.0 + 19.1.0 pom import @@ -45,7 +45,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:19.0.0') +implementation platform('com.google.cloud:libraries-bom:19.1.0') compile 'com.google.cloud:google-cloud-bigquerystorage' ``` From 4499688c2b78fbd7335fac013f42d3eb3ac9ac5a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 19 Mar 2021 19:04:07 +0100 Subject: [PATCH 07/15] chore(deps): update dependency com.google.cloud:libraries-bom to v19.2.1 (#954) [![WhiteSource 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:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `19.2.0` -> `19.2.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/19.2.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/19.2.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/19.2.1/compatibility-slim/19.2.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/19.2.1/confidence-slim/19.2.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquerystorage). --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index effd9b9511..2c2d7ae6d2 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -31,7 +31,7 @@ com.google.cloud libraries-bom - 19.2.0 + 19.2.1 pom import From c810c7279bfbad31cb0f94f5ad5d4a74342d4481 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 22 Mar 2021 16:15:41 +0100 Subject: [PATCH 08/15] deps: update dependency com.google.cloud:google-cloud-bigquery to v1.127.10 (#955) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ecd8710d69..3e8e2f35b4 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-bigquery - 1.127.9 + 1.127.10 com.google.api.grpc From a6b53566cfd174fb36a903cbd84948defc0403e6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 22 Mar 2021 08:30:03 -0700 Subject: [PATCH 09/15] chore: regenerate README (#950) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-03-18 22:45:20,095 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquerystorage/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-03-18 22:45:21,018 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/93099bcc-ab35-48d5-ab7a-79fbfbcb0bba/targets - [ ] To automatically regenerate this PR, check this box. --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 0204d77b54..d77f202c6a 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquerystorage.git", - "sha": "1554247cf55aa56281a530c721ab1650699a3efc" + "sha": "3835c8083b912a13d4ff4d7d08adca5e98c6ae99" } }, { diff --git a/README.md b/README.md index 0a37147361..e9dcdb5b11 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 19.1.0 + 19.2.0 pom import @@ -38,25 +38,25 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquerystorage - 1.15.0 + 1.15.1 ``` If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:19.1.0') +implementation platform('com.google.cloud:libraries-bom:19.2.0') compile 'com.google.cloud:google-cloud-bigquerystorage' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquerystorage:1.15.0' +compile 'com.google.cloud:google-cloud-bigquerystorage:1.15.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquerystorage" % "1.15.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquerystorage" % "1.15.1" ``` ## Authentication From 5a63ea5828e03a244c562d40f48d3065b6deea67 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 22 Mar 2021 08:58:02 -0700 Subject: [PATCH 10/15] chore: regenerate README (#956) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-03-22 15:32:14,816 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquerystorage/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-03-22 15:32:15,852 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/9be4b08c-65bc-4ddb-81cf-9402bf4f1a1b/targets - [ ] To automatically regenerate this PR, check this box. --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index d77f202c6a..8ed19f97e4 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquerystorage.git", - "sha": "3835c8083b912a13d4ff4d7d08adca5e98c6ae99" + "sha": "a6b53566cfd174fb36a903cbd84948defc0403e6" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "78437c732a60c64895778697b078497b0988346c" + "sha": "79c8dd7ee768292f933012d3a69a5b4676404cda" } } ] diff --git a/README.md b/README.md index e9dcdb5b11..570237b59c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 19.2.0 + 19.2.1 pom import @@ -45,7 +45,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:19.2.0') +implementation platform('com.google.cloud:libraries-bom:19.2.1') compile 'com.google.cloud:google-cloud-bigquerystorage' ``` From fce52890c6948a9b78a62d2fe0e4f9768d10d401 Mon Sep 17 00:00:00 2001 From: Yiru Tang Date: Wed, 24 Mar 2021 16:42:28 -0700 Subject: [PATCH 11/15] fix: add a deprecation message on StreamWriter (#922) * fix: add a deprecation message on StreamWriter; * . * . --- .../cloud/bigquery/storage/v1beta2/StreamWriter.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriter.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriter.java index 59eb681545..4a937b6be5 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriter.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriter.java @@ -61,11 +61,9 @@ import org.threeten.bp.Duration; /** - * A BigQuery Stream Writer that can be used to write data into BigQuery Table. - * - *

This is to be used to managed streaming write when you are working with PENDING streams or - * want to explicitly manage offset. In that most common cases when writing with COMMITTED stream - * without offset, please use a simpler writer {@code DirectWriter}. + * This is to be used to managed streaming write when you are working with PENDING streams or want + * to explicitly manage offset. In that most common cases when writing with COMMITTED stream without + * offset, please use a simpler writer {@code DirectWriter}. * *

A {@link StreamWrier} provides built-in capabilities to: handle batching of messages; * controlling memory utilization (through flow control) and request cleanup (only keeps write @@ -80,7 +78,10 @@ * *

{@link StreamWriter} will use the credentials set on the channel, which uses application * default credentials through {@link GoogleCredentials#getApplicationDefault} by default. + * + * @deprecated use {@link #StreamWriterV2()} instead. */ +@Deprecated public class StreamWriter implements AutoCloseable { private static final Logger LOG = Logger.getLogger(StreamWriter.class.getName()); From 4442583af775513d00cc22d632af18d983309e35 Mon Sep 17 00:00:00 2001 From: JacobStocklass <35313153+JacobStocklass@users.noreply.github.com> Date: Wed, 24 Mar 2021 23:45:24 +0000 Subject: [PATCH 12/15] test: E2E test for time encoding (#941) * Place Holder Stress Test for Setup * Making a basic long running test for the Write API * Simple stress test placeholder in folder st. * Add simple time caclulation * Cleaning up before submitting pull * caching changes * Cleaning up and adding TODO * Added copywrite info at beginning of file * Removing error causing lines * Moving Before class into single test to fix permissions issues * Ran mvn format, should fix lint errors * Resolving comments, removing unneccsary code * Fixing comments and cleaning up * Moved creation of client back into BeforeClass and resolved some other comments * Formating fix * Changed name from ST to IT to fix errors * Formatting * Aggregating data and logging once * Refactoring down to only the simple case. Complex case will be handled in a different PR * Quick rename * Adding complex schema default stream test * Formatting * Adding Time Encoding Integration Test Placeholder * Removing Stress test from this branch and moving it to the appropriate branch * Add integration test to make sure that encoding and decoding across a table insertion holds up * Added Integration test, renamed functions and got rid of redundant functions * Fix License Header * Java Lang set to 8 in order to use Java Local Time * Removing nano functions, cleaning up comments * Added round trip test to unit tests * Moving to threeten time instead of java time * Removing Java Time Dependency * Lint * Adding Time Encoding Integration Test Placeholder * Removing Stress test from this branch and moving it to the appropriate branch * Add integration test to make sure that encoding and decoding across a table insertion holds up * Added Integration test, renamed functions and got rid of redundant functions * Fix License Header * Java Lang set to 8 in order to use Java Local Time * Removing nano functions, cleaning up comments * Added round trip test to unit tests * Moving to threeten time instead of java time * Removing Java Time Dependency * Lint * Remove E2E test for another PR. Split Unit tests into better named tests * Lint * Combining Encode and Decode Test for easier reading * Removing unused methods * Adding Time Encoding Integration Test Placeholder * Removing Stress test from this branch and moving it to the appropriate branch * Add integration test to make sure that encoding and decoding across a table insertion holds up * Added Integration test, renamed functions and got rid of redundant functions * Fix License Header * Java Lang set to 8 in order to use Java Local Time * Removing nano functions, cleaning up comments * Added round trip test to unit tests * Moving to threeten time instead of java time * Removing Java Time Dependency * Lint * Remove E2E test for another PR. Split Unit tests into better named tests * Lint * Combining Encode and Decode Test for easier reading * Removing unused methods * E2E test for time encoding with supporting change to BQTableSchemaToProtoDescriptor * Remove INT64 fields and make Time fields repeated * Lint * Dealing with errors in BQTableSchemaToProtoDescriptorTest * Fixing testing to accept new Time format as integer. * deps: update dependency com.google.cloud:google-cloud-bigquery to v1.127.10 (#955) * chore: regenerate README (#950) This PR was generated using Autosynth. :rainbow:

Log from Synthtool ``` 2021-03-18 22:45:20,095 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquerystorage/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-03-18 22:45:21,018 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/93099bcc-ab35-48d5-ab7a-79fbfbcb0bba/targets - [ ] To automatically regenerate this PR, check this box. * chore: regenerate README (#956) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-03-22 15:32:14,816 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquerystorage/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-03-22 15:32:15,852 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/9be4b08c-65bc-4ddb-81cf-9402bf4f1a1b/targets - [ ] To automatically regenerate this PR, check this box. * Fixing manual write client test * Removing Stress Test, will be moved to its own repository for kokoro job. * Cleaning up unneccessary diffs * Cleaning up uneccessary diffs * Small change to retrigger Integration Tests Co-authored-by: WhiteSource Renovate Co-authored-by: Yoshi Automation Bot --- .github/readme/synth.metadata/synth.metadata | 4 +- README.md | 10 +- .../BQTableSchemaToProtoDescriptor.java | 4 +- .../BQTableSchemaToProtoDescriptorTest.java | 2 +- .../BQTableSchemaToProtoDescriptorTest.java | 4 +- .../storage/v1beta2/CivilTimeEncoderTest.java | 2 +- .../storage/v1beta2/JsonStreamWriterTest.java | 5 +- .../v1beta2/it/ITBigQueryTimeEncoderTest.java | 166 ++++++++++++++++ .../it/ITBigQueryWriteManualClientTest.java | 9 +- ...ITBigQueryStorageLongRunningWriteTest.java | 181 ------------------ .../src/test/proto/jsonTest.proto | 2 +- pom.xml | 2 +- 12 files changed, 191 insertions(+), 200 deletions(-) create mode 100644 google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/it/ITBigQueryTimeEncoderTest.java delete mode 100644 google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/st/ITBigQueryStorageLongRunningWriteTest.java diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 8ed19f97e4..0204d77b54 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquerystorage.git", - "sha": "a6b53566cfd174fb36a903cbd84948defc0403e6" + "sha": "1554247cf55aa56281a530c721ab1650699a3efc" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "79c8dd7ee768292f933012d3a69a5b4676404cda" + "sha": "78437c732a60c64895778697b078497b0988346c" } } ] diff --git a/README.md b/README.md index 570237b59c..0a37147361 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 19.2.1 + 19.1.0 pom import @@ -38,25 +38,25 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquerystorage - 1.15.1 + 1.15.0 ``` If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:19.2.1') +implementation platform('com.google.cloud:libraries-bom:19.1.0') compile 'com.google.cloud:google-cloud-bigquerystorage' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquerystorage:1.15.1' +compile 'com.google.cloud:google-cloud-bigquerystorage:1.15.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquerystorage" % "1.15.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquerystorage" % "1.15.0" ``` ## Authentication diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BQTableSchemaToProtoDescriptor.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BQTableSchemaToProtoDescriptor.java index 4ab936619c..e4aa97798f 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BQTableSchemaToProtoDescriptor.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BQTableSchemaToProtoDescriptor.java @@ -47,14 +47,14 @@ public class BQTableSchemaToProtoDescriptor { .put(TableFieldSchema.Type.BOOL, FieldDescriptorProto.Type.TYPE_BOOL) .put(TableFieldSchema.Type.BYTES, FieldDescriptorProto.Type.TYPE_BYTES) .put(TableFieldSchema.Type.DATE, FieldDescriptorProto.Type.TYPE_INT32) - .put(TableFieldSchema.Type.DATETIME, FieldDescriptorProto.Type.TYPE_STRING) + .put(TableFieldSchema.Type.DATETIME, FieldDescriptorProto.Type.TYPE_INT64) .put(TableFieldSchema.Type.DOUBLE, FieldDescriptorProto.Type.TYPE_DOUBLE) .put(TableFieldSchema.Type.GEOGRAPHY, FieldDescriptorProto.Type.TYPE_STRING) .put(TableFieldSchema.Type.INT64, FieldDescriptorProto.Type.TYPE_INT64) .put(TableFieldSchema.Type.NUMERIC, FieldDescriptorProto.Type.TYPE_STRING) .put(TableFieldSchema.Type.STRING, FieldDescriptorProto.Type.TYPE_STRING) .put(TableFieldSchema.Type.STRUCT, FieldDescriptorProto.Type.TYPE_MESSAGE) - .put(TableFieldSchema.Type.TIME, FieldDescriptorProto.Type.TYPE_STRING) + .put(TableFieldSchema.Type.TIME, FieldDescriptorProto.Type.TYPE_INT64) .put(TableFieldSchema.Type.TIMESTAMP, FieldDescriptorProto.Type.TYPE_INT64) .build(); diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/BQTableSchemaToProtoDescriptorTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/BQTableSchemaToProtoDescriptorTest.java index 85bba343ac..63c51cf56c 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/BQTableSchemaToProtoDescriptorTest.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/BQTableSchemaToProtoDescriptorTest.java @@ -201,7 +201,7 @@ public void testStructComplex() throws Exception { .build(); final Table.TableFieldSchema TEST_TIME = Table.TableFieldSchema.newBuilder() - .setType(Table.TableFieldSchema.Type.TIME) + .setType(Table.TableFieldSchema.Type.INT64) .setMode(Table.TableFieldSchema.Mode.NULLABLE) .setName("test_time") .build(); diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/BQTableSchemaToProtoDescriptorTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/BQTableSchemaToProtoDescriptorTest.java index 4cb658f638..e5d0676975 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/BQTableSchemaToProtoDescriptorTest.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/BQTableSchemaToProtoDescriptorTest.java @@ -38,13 +38,13 @@ public class BQTableSchemaToProtoDescriptorTest { .put(TableFieldSchema.Type.BOOL, BoolType.getDescriptor()) .put(TableFieldSchema.Type.BYTES, BytesType.getDescriptor()) .put(TableFieldSchema.Type.DATE, Int32Type.getDescriptor()) - .put(TableFieldSchema.Type.DATETIME, StringType.getDescriptor()) + .put(TableFieldSchema.Type.DATETIME, Int64Type.getDescriptor()) .put(TableFieldSchema.Type.DOUBLE, DoubleType.getDescriptor()) .put(TableFieldSchema.Type.GEOGRAPHY, StringType.getDescriptor()) .put(TableFieldSchema.Type.INT64, Int64Type.getDescriptor()) .put(TableFieldSchema.Type.NUMERIC, StringType.getDescriptor()) .put(TableFieldSchema.Type.STRING, StringType.getDescriptor()) - .put(TableFieldSchema.Type.TIME, StringType.getDescriptor()) + .put(TableFieldSchema.Type.TIME, Int64Type.getDescriptor()) .put(TableFieldSchema.Type.TIMESTAMP, Int64Type.getDescriptor()) .build(); diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/CivilTimeEncoderTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/CivilTimeEncoderTest.java index 5711a05617..673d3b0eab 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/CivilTimeEncoderTest.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/CivilTimeEncoderTest.java @@ -151,7 +151,7 @@ public void decodePacked64TimeMicros_invalidHourOfDay_throwsIllegalArgumentExcep } } - // Date Time + // Date Time Tests @Test public void encodeAndDecodePacked64DatetimeMicros_validDateTime() { // 0001/01/01 00:00:00 diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/JsonStreamWriterTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/JsonStreamWriterTest.java index 0f68ae9c79..1205aa9615 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/JsonStreamWriterTest.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/JsonStreamWriterTest.java @@ -48,6 +48,7 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.threeten.bp.Instant; +import org.threeten.bp.LocalTime; @RunWith(JUnit4.class) public class JsonStreamWriterTest { @@ -410,7 +411,7 @@ public void testSingleAppendComplexJson() throws Exception { .setTestNumeric("1.23456") .setTestGeo("POINT(1,1)") .setTestTimestamp(12345678) - .setTestTime("01:00:01") + .setTestTime(CivilTimeEncoder.encodePacked64TimeMicros(LocalTime.of(1, 0, 1))) .build(); JSONObject complex_lvl2 = new JSONObject(); complex_lvl2.put("test_int", 3); @@ -431,7 +432,7 @@ public void testSingleAppendComplexJson() throws Exception { json.put("test_numeric", "1.23456"); json.put("test_geo", "POINT(1,1)"); json.put("test_timestamp", 12345678); - json.put("test_time", "01:00:01"); + json.put("test_time", CivilTimeEncoder.encodePacked64TimeMicros(LocalTime.of(1, 0, 1))); JSONArray jsonArr = new JSONArray(); jsonArr.put(json); diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/it/ITBigQueryTimeEncoderTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/it/ITBigQueryTimeEncoderTest.java new file mode 100644 index 0000000000..28647b2ccf --- /dev/null +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/it/ITBigQueryTimeEncoderTest.java @@ -0,0 +1,166 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.storage.v1beta2.it; + +import static org.junit.Assert.assertEquals; + +import com.google.api.core.ApiFuture; +import com.google.cloud.ServiceOptions; +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.DatasetInfo; +import com.google.cloud.bigquery.Field.Mode; +import com.google.cloud.bigquery.FieldValueList; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.StandardTableDefinition; +import com.google.cloud.bigquery.TableId; +import com.google.cloud.bigquery.TableInfo; +import com.google.cloud.bigquery.TableResult; +import com.google.cloud.bigquery.storage.v1beta2.AppendRowsResponse; +import com.google.cloud.bigquery.storage.v1beta2.BigQueryWriteClient; +import com.google.cloud.bigquery.storage.v1beta2.CivilTimeEncoder; +import com.google.cloud.bigquery.storage.v1beta2.JsonStreamWriter; +import com.google.cloud.bigquery.storage.v1beta2.TableName; +import com.google.cloud.bigquery.testing.RemoteBigQueryHelper; +import com.google.protobuf.Descriptors; +import java.io.IOException; +import java.util.Iterator; +import java.util.concurrent.ExecutionException; +import org.json.JSONArray; +import org.json.JSONObject; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.LocalTime; + +public class ITBigQueryTimeEncoderTest { + private static final String DATASET = RemoteBigQueryHelper.generateDatasetName(); + private static final String TABLE = "testtable"; + private static final String DESCRIPTION = "BigQuery Write Java manual client test dataset"; + + private static BigQueryWriteClient client; + private static TableInfo tableInfo; + private static BigQuery bigquery; + + @BeforeClass + public static void beforeClass() throws IOException { + client = BigQueryWriteClient.create(); + + RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); + bigquery = bigqueryHelper.getOptions().getService(); + DatasetInfo datasetInfo = + DatasetInfo.newBuilder(/* datasetId = */ DATASET).setDescription(DESCRIPTION).build(); + bigquery.create(datasetInfo); + tableInfo = + TableInfo.newBuilder( + TableId.of(DATASET, TABLE), + StandardTableDefinition.of( + Schema.of( + com.google.cloud.bigquery.Field.newBuilder( + "test_str", StandardSQLTypeName.STRING) + .build(), + com.google.cloud.bigquery.Field.newBuilder( + "test_time_micros", StandardSQLTypeName.TIME) + .setMode(Mode.REPEATED) + .build(), + com.google.cloud.bigquery.Field.newBuilder( + "test_datetime_micros", StandardSQLTypeName.DATETIME) + .setMode(Mode.REPEATED) + .build()))) + .build(); + bigquery.create(tableInfo); + } + + @AfterClass + public static void afterClass() { + if (client != null) { + client.close(); + } + if (bigquery != null) { + RemoteBigQueryHelper.forceDelete(bigquery, DATASET); + } + } + + @Test + public void TestTimeEncoding() + throws IOException, InterruptedException, ExecutionException, + Descriptors.DescriptorValidationException { + TableName parent = TableName.of(ServiceOptions.getDefaultProjectId(), DATASET, TABLE); + try (JsonStreamWriter jsonStreamWriter = + JsonStreamWriter.newBuilder(parent.toString(), tableInfo.getDefinition().getSchema()) + .createDefaultStream() + .build()) { + JSONObject row = new JSONObject(); + row.put("test_str", "Start of the day"); + row.put( + "test_time_micros", + new JSONArray( + new long[] { + CivilTimeEncoder.encodePacked64TimeMicros(LocalTime.of(13, 14, 15, 16_000_000)), + CivilTimeEncoder.encodePacked64TimeMicros(LocalTime.of(23, 59, 59, 999_999_000)), + CivilTimeEncoder.encodePacked64TimeMicros(LocalTime.of(0, 0, 0, 0)), + CivilTimeEncoder.encodePacked64TimeMicros(LocalTime.of(1, 2, 3, 4_000)), + CivilTimeEncoder.encodePacked64TimeMicros(LocalTime.of(5, 6, 7, 8_000)) + })); + row.put( + "test_datetime_micros", + new JSONArray( + new long[] { + CivilTimeEncoder.encodePacked64DatetimeMicros( + LocalDateTime.of(1, 1, 1, 12, 0, 0, 0)), + CivilTimeEncoder.encodePacked64DatetimeMicros( + LocalDateTime.of(1995, 5, 19, 10, 30, 45, 0)), + CivilTimeEncoder.encodePacked64DatetimeMicros( + LocalDateTime.of(2000, 1, 1, 0, 0, 0, 0)), + CivilTimeEncoder.encodePacked64DatetimeMicros( + LocalDateTime.of(2026, 3, 11, 5, 45, 12, 9_000_000)), + CivilTimeEncoder.encodePacked64DatetimeMicros( + LocalDateTime.of(2050, 1, 2, 3, 4, 5, 6_000)), + })); + JSONArray jsonArr = new JSONArray(new JSONObject[] {row}); + ApiFuture response = jsonStreamWriter.append(jsonArr, -1); + Assert.assertFalse(response.get().getAppendResult().hasOffset()); + TableResult result = + bigquery.listTableData( + tableInfo.getTableId(), BigQuery.TableDataListOption.startIndex(0L)); + Iterator iter = result.getValues().iterator(); + FieldValueList currentRow; + currentRow = iter.next(); + assertEquals("Start of the day", currentRow.get(0).getValue()); + assertEquals("13:14:15.016000", currentRow.get(1).getRepeatedValue().get(0).getStringValue()); + assertEquals("23:59:59.999999", currentRow.get(1).getRepeatedValue().get(1).getStringValue()); + assertEquals("00:00:00", currentRow.get(1).getRepeatedValue().get(2).getStringValue()); + assertEquals("01:02:03.000004", currentRow.get(1).getRepeatedValue().get(3).getStringValue()); + assertEquals("05:06:07.000008", currentRow.get(1).getRepeatedValue().get(4).getStringValue()); + + assertEquals( + "0001-01-01T12:00:00", currentRow.get(2).getRepeatedValue().get(0).getStringValue()); + assertEquals( + "1995-05-19T10:30:45", currentRow.get(2).getRepeatedValue().get(1).getStringValue()); + assertEquals( + "2000-01-01T00:00:00", currentRow.get(2).getRepeatedValue().get(2).getStringValue()); + assertEquals( + "2026-03-11T05:45:12.009000", + currentRow.get(2).getRepeatedValue().get(3).getStringValue()); + assertEquals( + "2050-01-02T03:04:05.000006", + currentRow.get(2).getRepeatedValue().get(4).getStringValue()); + } + } +} diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/it/ITBigQueryWriteManualClientTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/it/ITBigQueryWriteManualClientTest.java index 2e1fd95ed8..ddfbd08e4d 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/it/ITBigQueryWriteManualClientTest.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/it/ITBigQueryWriteManualClientTest.java @@ -41,6 +41,7 @@ import org.junit.BeforeClass; import org.junit.Test; import org.threeten.bp.Duration; +import org.threeten.bp.LocalDateTime; /** Integration tests for BigQuery Write API. */ public class ITBigQueryWriteManualClientTest { @@ -240,7 +241,9 @@ public void testJsonStreamWriterCommittedStream() JSONObject row1 = new JSONObject(); row1.put("test_str", "aaa"); row1.put("test_numerics", new JSONArray(new String[] {"123.4", "-9000000"})); - row1.put("test_datetime", "2020-10-1 12:00:00"); + row1.put( + "test_datetime", + CivilTimeEncoder.encodePacked64DatetimeMicros(LocalDateTime.of(2020, 10, 1, 12, 0))); JSONArray jsonArr1 = new JSONArray(new JSONObject[] {row1}); ApiFuture response1 = jsonStreamWriter.append(jsonArr1, -1); @@ -313,7 +316,9 @@ public void testJsonStreamWriterWithDefaultStream() JSONObject row1 = new JSONObject(); row1.put("test_str", "aaa"); row1.put("test_numerics", new JSONArray(new String[] {"123.4", "-9000000"})); - row1.put("test_datetime", "2020-10-1 12:00:00"); + row1.put( + "test_datetime", + CivilTimeEncoder.encodePacked64DatetimeMicros(LocalDateTime.of(2020, 10, 1, 12, 0))); JSONArray jsonArr1 = new JSONArray(new JSONObject[] {row1}); ApiFuture response1 = jsonStreamWriter.append(jsonArr1, -1); diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/st/ITBigQueryStorageLongRunningWriteTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/st/ITBigQueryStorageLongRunningWriteTest.java deleted file mode 100644 index 7e978e7f36..0000000000 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/st/ITBigQueryStorageLongRunningWriteTest.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.bigquery.storage.v1beta2.st; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import com.google.api.core.ApiFuture; -import com.google.cloud.ServiceOptions; -import com.google.cloud.bigquery.BigQuery; -import com.google.cloud.bigquery.DatasetInfo; -import com.google.cloud.bigquery.Field; -import com.google.cloud.bigquery.FieldValueList; -import com.google.cloud.bigquery.Schema; -import com.google.cloud.bigquery.StandardSQLTypeName; -import com.google.cloud.bigquery.StandardTableDefinition; -import com.google.cloud.bigquery.TableId; -import com.google.cloud.bigquery.TableInfo; -import com.google.cloud.bigquery.TableResult; -import com.google.cloud.bigquery.storage.v1beta2.AppendRowsResponse; -import com.google.cloud.bigquery.storage.v1beta2.BigQueryWriteClient; -import com.google.cloud.bigquery.storage.v1beta2.JsonStreamWriter; -import com.google.cloud.bigquery.storage.v1beta2.TableName; -import com.google.cloud.bigquery.storage.v1beta2.it.ITBigQueryStorageLongRunningTest; -import com.google.cloud.bigquery.testing.RemoteBigQueryHelper; -import com.google.protobuf.Descriptors; -import java.io.IOException; -import java.util.Iterator; -import java.util.concurrent.ExecutionException; -import java.util.logging.Logger; -import org.json.JSONArray; -import org.json.JSONObject; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import org.threeten.bp.LocalDateTime; - -public class ITBigQueryStorageLongRunningWriteTest { - public enum RowComplexity { - SIMPLE, - COMPLEX - } - - private static final Logger LOG = - Logger.getLogger(ITBigQueryStorageLongRunningTest.class.getName()); - private static final String LONG_TESTS_ENABLED_PROPERTY = - "bigquery.storage.enable_long_running_tests"; - private static final String DESCRIPTION = "BigQuery Write Java long test dataset"; - - private static String dataset; - private static BigQueryWriteClient client; - private static String parentProjectId; - private static BigQuery bigquery; - - private static JSONObject MakeJsonObject(RowComplexity complexity) throws IOException { - JSONObject object = new JSONObject(); - // size: (1, simple)(2,complex)() - // TODO(jstocklass): Add option for testing protobuf format using StreamWriter2 - switch (complexity) { - case SIMPLE: - object.put("test_str", "aaa"); - object.put("test_numerics", new JSONArray(new String[] {"1234", "-900000"})); - object.put("test_datetime", String.valueOf(LocalDateTime.now())); - break; - case COMPLEX: - // TODO(jstocklass): make a complex object - default: - break; - } - return object; - } - - @BeforeClass - public static void beforeClass() throws IOException { - parentProjectId = String.format("projects/%s", ServiceOptions.getDefaultProjectId()); - - client = BigQueryWriteClient.create(); - RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); - bigquery = bigqueryHelper.getOptions().getService(); - dataset = RemoteBigQueryHelper.generateDatasetName(); - DatasetInfo datasetInfo = - DatasetInfo.newBuilder(/* datasetId = */ dataset).setDescription(DESCRIPTION).build(); - LOG.info("Creating dataset: " + dataset); - bigquery.create(datasetInfo); - } - - @AfterClass - public static void afterClass() { - if (client != null) { - client.close(); - } - if (bigquery != null && dataset != null) { - RemoteBigQueryHelper.forceDelete(bigquery, dataset); - LOG.info("Deleted test dataset: " + dataset); - } - } - - @Test - public void testDefaultStreamSimpleSchema() - throws IOException, InterruptedException, ExecutionException, - Descriptors.DescriptorValidationException { - // TODO(jstocklass): Set up a default stream. Write to it for a long time, - // (a few minutes for now) and make sure that everything goes well, report stats. - LOG.info( - String.format( - "%s tests running with parent project: %s", - ITBigQueryStorageLongRunningWriteTest.class.getSimpleName(), parentProjectId)); - - String tableName = "JsonSimpleTableDefaultStream"; - TableInfo tableInfo = - TableInfo.newBuilder( - TableId.of(dataset, tableName), - StandardTableDefinition.of( - Schema.of( - com.google.cloud.bigquery.Field.newBuilder( - "test_str", StandardSQLTypeName.STRING) - .build(), - com.google.cloud.bigquery.Field.newBuilder( - "test_numerics", StandardSQLTypeName.NUMERIC) - .setMode(Field.Mode.REPEATED) - .build(), - com.google.cloud.bigquery.Field.newBuilder( - "test_datetime", StandardSQLTypeName.DATETIME) - .build()))) - .build(); - bigquery.create(tableInfo); - - int requestLimit = 10; - long averageLatency = 0; - long totalLatency = 0; - TableName parent = TableName.of(ServiceOptions.getDefaultProjectId(), dataset, tableName); - try (JsonStreamWriter jsonStreamWriter = - JsonStreamWriter.newBuilder(parent.toString(), tableInfo.getDefinition().getSchema()) - .createDefaultStream() - .build()) { - for (int i = 0; i < requestLimit; i++) { - JSONObject row = MakeJsonObject(RowComplexity.SIMPLE); - JSONArray jsonArr = new JSONArray(new JSONObject[] {row}); - long startTime = System.nanoTime(); - // TODO(jstocklass): Make asynchronized calls instead of synchronized calls - ApiFuture response = jsonStreamWriter.append(jsonArr, -1); - long finishTime = System.nanoTime(); - Assert.assertFalse(response.get().getAppendResult().hasOffset()); - // Ignore first entry, it is way slower than the others and ruins expected behavior - if (i != 0) { - totalLatency += (finishTime - startTime); - } - } - averageLatency = totalLatency / requestLimit; - // TODO(jstocklass): Is there a better way to get this than to log it? - LOG.info("Simple average Latency: " + String.valueOf(averageLatency) + " ns"); - averageLatency = totalLatency = 0; - - TableResult result = - bigquery.listTableData( - tableInfo.getTableId(), BigQuery.TableDataListOption.startIndex(0L)); - Iterator iter = result.getValues().iterator(); - FieldValueList currentRow; - for (int i = 0; i < requestLimit; i++) { - assertTrue(iter.hasNext()); - currentRow = iter.next(); - assertEquals("aaa", currentRow.get(0).getStringValue()); - } - assertEquals(false, iter.hasNext()); - } - } -} diff --git a/google-cloud-bigquerystorage/src/test/proto/jsonTest.proto b/google-cloud-bigquerystorage/src/test/proto/jsonTest.proto index 909cdd8592..2a7643252a 100644 --- a/google-cloud-bigquerystorage/src/test/proto/jsonTest.proto +++ b/google-cloud-bigquerystorage/src/test/proto/jsonTest.proto @@ -14,7 +14,7 @@ message ComplexRoot { optional string test_numeric = 9; optional string test_geo = 10; optional int64 test_timestamp = 11; - optional string test_time = 12; + optional int64 test_time = 12; } message CasingComplex { diff --git a/pom.xml b/pom.xml index 3e8e2f35b4..ecd8710d69 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-bigquery - 1.127.10 + 1.127.9 com.google.api.grpc From ab3c1453d3c1fb627e773d0e7ca4ec991f8d38b7 Mon Sep 17 00:00:00 2001 From: Mike Wasson <3992422+MikeWasson@users.noreply.github.com> Date: Wed, 24 Mar 2021 17:14:02 -0700 Subject: [PATCH 13/15] docs(samples): Check for error from BatchCommitWriteStreams (#940) If the returned BatchCommitWriteStreamsResponse does not have a commit time, it means an error occurred. --- .../com/example/bigquerystorage/WritePendingStream.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/samples/snippets/src/main/java/com/example/bigquerystorage/WritePendingStream.java b/samples/snippets/src/main/java/com/example/bigquerystorage/WritePendingStream.java index 813e59d957..1c7803986b 100644 --- a/samples/snippets/src/main/java/com/example/bigquerystorage/WritePendingStream.java +++ b/samples/snippets/src/main/java/com/example/bigquerystorage/WritePendingStream.java @@ -25,6 +25,7 @@ import com.google.cloud.bigquery.storage.v1beta2.CreateWriteStreamRequest; import com.google.cloud.bigquery.storage.v1beta2.FinalizeWriteStreamResponse; import com.google.cloud.bigquery.storage.v1beta2.JsonStreamWriter; +import com.google.cloud.bigquery.storage.v1beta2.StorageError; import com.google.cloud.bigquery.storage.v1beta2.TableName; import com.google.cloud.bigquery.storage.v1beta2.WriteStream; import com.google.protobuf.Descriptors.DescriptorValidationException; @@ -90,6 +91,13 @@ public static void writePendingStream(String projectId, String datasetName, Stri .build(); BatchCommitWriteStreamsResponse commitResponse = client.batchCommitWriteStreams(commitRequest); + // If the response does not have a commit time, it means the commit operation failed. + if (commitResponse.hasCommitTime() == false) { + for (StorageError err : commitResponse.getStreamErrorsList()) { + System.out.println(err.getErrorMessage()); + } + throw new RuntimeException("Error committing the streams"); + } System.out.println("Appended and committed records successfully."); } catch (ExecutionException e) { // If the wrapped exception is a StatusRuntimeException, check the state of the operation. From 11f62c9ebf136d8cb021d93db3f1d1464322ff8c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 24 Mar 2021 17:24:02 -0700 Subject: [PATCH 14/15] chore: regenerate README (#960) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-03-24 23:45:28,083 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquerystorage/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-03-24 23:45:29,183 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/a65a9b88-e084-42d0-9806-f06907a2a06f/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 0204d77b54..afecc8eee3 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquerystorage.git", - "sha": "1554247cf55aa56281a530c721ab1650699a3efc" + "sha": "4442583af775513d00cc22d632af18d983309e35" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "78437c732a60c64895778697b078497b0988346c" + "sha": "bb854b6c048619e3be4e8b8ce8ed10aa74ea78ef" } } ] diff --git a/README.md b/README.md index 0a37147361..570237b59c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 19.1.0 + 19.2.1 pom import @@ -38,25 +38,25 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquerystorage - 1.15.0 + 1.15.1 ``` If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:19.1.0') +implementation platform('com.google.cloud:libraries-bom:19.2.1') compile 'com.google.cloud:google-cloud-bigquerystorage' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquerystorage:1.15.0' +compile 'com.google.cloud:google-cloud-bigquerystorage:1.15.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquerystorage" % "1.15.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquerystorage" % "1.15.1" ``` ## Authentication From 8b71ac9e2d19504347688f50c51494c1414b6fb1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 25 Mar 2021 17:18:03 +0000 Subject: [PATCH 15/15] chore: release 1.16.0 (#949) :robot: I have created a release \*beep\* \*boop\* --- ## [1.16.0](https://www.github.com/googleapis/java-bigquerystorage/compare/v1.15.1...v1.16.0) (2021-03-25) ### Features * Add CivilTimeEncoder to encode and decode DateTime/Time as numerics ([#937](https://www.github.com/googleapis/java-bigquerystorage/issues/937)) ([969b429](https://www.github.com/googleapis/java-bigquerystorage/commit/969b4290b9934b94b1a0113e04e37ff44b2a536e)) ### Bug Fixes * add a deprecation message on StreamWriter ([#922](https://www.github.com/googleapis/java-bigquerystorage/issues/922)) ([fce5289](https://www.github.com/googleapis/java-bigquerystorage/commit/fce52890c6948a9b78a62d2fe0e4f9768d10d401)) ### Dependencies * update dependency com.google.cloud:google-cloud-bigquery to v1.127.10 ([#955](https://www.github.com/googleapis/java-bigquerystorage/issues/955)) ([c810c72](https://www.github.com/googleapis/java-bigquerystorage/commit/c810c7279bfbad31cb0f94f5ad5d4a74342d4481)) * update dependency com.google.cloud:google-cloud-bigquery to v1.127.9 ([#947](https://www.github.com/googleapis/java-bigquerystorage/issues/947)) ([d781dc5](https://www.github.com/googleapis/java-bigquerystorage/commit/d781dc5479602fee01eb971033978317e5669694)) ### Documentation * **samples:** Check for error from BatchCommitWriteStreams ([#940](https://www.github.com/googleapis/java-bigquerystorage/issues/940)) ([ab3c145](https://www.github.com/googleapis/java-bigquerystorage/commit/ab3c1453d3c1fb627e773d0e7ca4ec991f8d38b7)) --- 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 | 23 +++++++++++++++++++ google-cloud-bigquerystorage-bom/pom.xml | 20 ++++++++-------- google-cloud-bigquerystorage/pom.xml | 4 ++-- grpc-google-cloud-bigquerystorage-v1/pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- pom.xml | 20 ++++++++-------- proto-google-cloud-bigquerystorage-v1/pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 18 +++++++-------- 14 files changed, 71 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99aea3f750..77f3ab8f43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [1.16.0](https://www.github.com/googleapis/java-bigquerystorage/compare/v1.15.1...v1.16.0) (2021-03-25) + + +### Features + +* Add CivilTimeEncoder to encode and decode DateTime/Time as numerics ([#937](https://www.github.com/googleapis/java-bigquerystorage/issues/937)) ([969b429](https://www.github.com/googleapis/java-bigquerystorage/commit/969b4290b9934b94b1a0113e04e37ff44b2a536e)) + + +### Bug Fixes + +* add a deprecation message on StreamWriter ([#922](https://www.github.com/googleapis/java-bigquerystorage/issues/922)) ([fce5289](https://www.github.com/googleapis/java-bigquerystorage/commit/fce52890c6948a9b78a62d2fe0e4f9768d10d401)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigquery to v1.127.10 ([#955](https://www.github.com/googleapis/java-bigquerystorage/issues/955)) ([c810c72](https://www.github.com/googleapis/java-bigquerystorage/commit/c810c7279bfbad31cb0f94f5ad5d4a74342d4481)) +* update dependency com.google.cloud:google-cloud-bigquery to v1.127.9 ([#947](https://www.github.com/googleapis/java-bigquerystorage/issues/947)) ([d781dc5](https://www.github.com/googleapis/java-bigquerystorage/commit/d781dc5479602fee01eb971033978317e5669694)) + + +### Documentation + +* **samples:** Check for error from BatchCommitWriteStreams ([#940](https://www.github.com/googleapis/java-bigquerystorage/issues/940)) ([ab3c145](https://www.github.com/googleapis/java-bigquerystorage/commit/ab3c1453d3c1fb627e773d0e7ca4ec991f8d38b7)) + ### [1.15.1](https://www.github.com/googleapis/java-bigquerystorage/compare/v1.15.0...v1.15.1) (2021-03-17) diff --git a/google-cloud-bigquerystorage-bom/pom.xml b/google-cloud-bigquerystorage-bom/pom.xml index d14df1e3ff..5098daadd1 100644 --- a/google-cloud-bigquerystorage-bom/pom.xml +++ b/google-cloud-bigquerystorage-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquerystorage-bom - 1.15.2-SNAPSHOT + 1.16.0 pom com.google.cloud @@ -63,48 +63,48 @@ com.google.api.grpc proto-google-cloud-bigquerystorage-v1alpha2 - 0.115.2-SNAPSHOT + 0.116.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta1 - 0.115.2-SNAPSHOT + 0.116.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta2 - 0.115.2-SNAPSHOT + 0.116.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1 - 1.15.2-SNAPSHOT + 1.16.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1alpha2 - 0.115.2-SNAPSHOT + 0.116.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta1 - 0.115.2-SNAPSHOT + 0.116.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta2 - 0.115.2-SNAPSHOT + 0.116.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1 - 1.15.2-SNAPSHOT + 1.16.0 com.google.cloud google-cloud-bigquerystorage - 1.15.2-SNAPSHOT + 1.16.0
diff --git a/google-cloud-bigquerystorage/pom.xml b/google-cloud-bigquerystorage/pom.xml index 50b5511b93..7b25a4a168 100644 --- a/google-cloud-bigquerystorage/pom.xml +++ b/google-cloud-bigquerystorage/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquerystorage - 1.15.2-SNAPSHOT + 1.16.0 jar BigQuery Storage https://github.com/googleapis/java-bigquerystorage @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquerystorage-parent - 1.15.2-SNAPSHOT + 1.16.0 google-cloud-bigquerystorage diff --git a/grpc-google-cloud-bigquerystorage-v1/pom.xml b/grpc-google-cloud-bigquerystorage-v1/pom.xml index 1cd5a68dcf..755691f9b2 100644 --- a/grpc-google-cloud-bigquerystorage-v1/pom.xml +++ b/grpc-google-cloud-bigquerystorage-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1 - 1.15.2-SNAPSHOT + 1.16.0 grpc-google-cloud-bigquerystorage-v1 GRPC library for grpc-google-cloud-bigquerystorage-v1 com.google.cloud google-cloud-bigquerystorage-parent - 1.15.2-SNAPSHOT + 1.16.0 diff --git a/grpc-google-cloud-bigquerystorage-v1alpha2/pom.xml b/grpc-google-cloud-bigquerystorage-v1alpha2/pom.xml index e4a953af5e..b127af25c8 100644 --- a/grpc-google-cloud-bigquerystorage-v1alpha2/pom.xml +++ b/grpc-google-cloud-bigquerystorage-v1alpha2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1alpha2 - 0.115.2-SNAPSHOT + 0.116.0 grpc-google-cloud-bigquerystorage-v1alpha2 GRPC library for grpc-google-cloud-bigquerystorage-v1alpha2 com.google.cloud google-cloud-bigquerystorage-parent - 1.15.2-SNAPSHOT + 1.16.0 diff --git a/grpc-google-cloud-bigquerystorage-v1beta1/pom.xml b/grpc-google-cloud-bigquerystorage-v1beta1/pom.xml index fb0a011cb9..297015a71e 100644 --- a/grpc-google-cloud-bigquerystorage-v1beta1/pom.xml +++ b/grpc-google-cloud-bigquerystorage-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta1 - 0.115.2-SNAPSHOT + 0.116.0 grpc-google-cloud-bigquerystorage-v1beta1 GRPC library for grpc-google-cloud-bigquerystorage-v1beta1 com.google.cloud google-cloud-bigquerystorage-parent - 1.15.2-SNAPSHOT + 1.16.0 diff --git a/grpc-google-cloud-bigquerystorage-v1beta2/pom.xml b/grpc-google-cloud-bigquerystorage-v1beta2/pom.xml index 0e7998b1f7..8711e17286 100644 --- a/grpc-google-cloud-bigquerystorage-v1beta2/pom.xml +++ b/grpc-google-cloud-bigquerystorage-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta2 - 0.115.2-SNAPSHOT + 0.116.0 grpc-google-cloud-bigquerystorage-v1beta2 GRPC library for grpc-google-cloud-bigquerystorage-v1beta2 com.google.cloud google-cloud-bigquerystorage-parent - 1.15.2-SNAPSHOT + 1.16.0 diff --git a/pom.xml b/pom.xml index ecd8710d69..9738b938a8 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquerystorage-parent pom - 1.15.2-SNAPSHOT + 1.16.0 BigQuery Storage Parent https://github.com/googleapis/java-bigquerystorage @@ -101,47 +101,47 @@ com.google.api.grpc proto-google-cloud-bigquerystorage-v1alpha2 - 0.115.2-SNAPSHOT + 0.116.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta1 - 0.115.2-SNAPSHOT + 0.116.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta2 - 0.115.2-SNAPSHOT + 0.116.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1 - 1.15.2-SNAPSHOT + 1.16.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1alpha2 - 0.115.2-SNAPSHOT + 0.116.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta1 - 0.115.2-SNAPSHOT + 0.116.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta2 - 0.115.2-SNAPSHOT + 0.116.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1 - 1.15.2-SNAPSHOT + 1.16.0 com.google.cloud google-cloud-bigquerystorage - 1.15.2-SNAPSHOT + 1.16.0 org.json diff --git a/proto-google-cloud-bigquerystorage-v1/pom.xml b/proto-google-cloud-bigquerystorage-v1/pom.xml index 65687963fb..e52d3bb640 100644 --- a/proto-google-cloud-bigquerystorage-v1/pom.xml +++ b/proto-google-cloud-bigquerystorage-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1 - 1.15.2-SNAPSHOT + 1.16.0 proto-google-cloud-bigquerystorage-v1 PROTO library for proto-google-cloud-bigquerystorage-v1 com.google.cloud google-cloud-bigquerystorage-parent - 1.15.2-SNAPSHOT + 1.16.0 diff --git a/proto-google-cloud-bigquerystorage-v1alpha2/pom.xml b/proto-google-cloud-bigquerystorage-v1alpha2/pom.xml index e5222f0f5c..a41d65fcc0 100644 --- a/proto-google-cloud-bigquerystorage-v1alpha2/pom.xml +++ b/proto-google-cloud-bigquerystorage-v1alpha2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1alpha2 - 0.115.2-SNAPSHOT + 0.116.0 proto-google-cloud-bigquerystorage-v1alpha2 PROTO library for proto-google-cloud-bigquerystorage-v1alpha2 com.google.cloud google-cloud-bigquerystorage-parent - 1.15.2-SNAPSHOT + 1.16.0 diff --git a/proto-google-cloud-bigquerystorage-v1beta1/pom.xml b/proto-google-cloud-bigquerystorage-v1beta1/pom.xml index 7766306ed5..4d337b841a 100644 --- a/proto-google-cloud-bigquerystorage-v1beta1/pom.xml +++ b/proto-google-cloud-bigquerystorage-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta1 - 0.115.2-SNAPSHOT + 0.116.0 proto-google-cloud-bigquerystorage-v1beta1 PROTO library for proto-google-cloud-bigquerystorage-v1beta1 com.google.cloud google-cloud-bigquerystorage-parent - 1.15.2-SNAPSHOT + 1.16.0 diff --git a/proto-google-cloud-bigquerystorage-v1beta2/pom.xml b/proto-google-cloud-bigquerystorage-v1beta2/pom.xml index 5a51b95d84..bc1936afbf 100644 --- a/proto-google-cloud-bigquerystorage-v1beta2/pom.xml +++ b/proto-google-cloud-bigquerystorage-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta2 - 0.115.2-SNAPSHOT + 0.116.0 proto-google-cloud-bigquerystorage-v1beta2 PROTO library for proto-google-cloud-bigquerystorage-v1beta2 com.google.cloud google-cloud-bigquerystorage-parent - 1.15.2-SNAPSHOT + 1.16.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index bf5418d1dd..fd9dc9d275 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-bigquerystorage - 1.15.2-SNAPSHOT + 1.16.0 diff --git a/versions.txt b/versions.txt index 83ed0e68c0..ee080f3711 100644 --- a/versions.txt +++ b/versions.txt @@ -1,12 +1,12 @@ # Format: # module:released-version:current-version -proto-google-cloud-bigquerystorage-v1alpha2:0.115.1:0.115.2-SNAPSHOT -proto-google-cloud-bigquerystorage-v1beta1:0.115.1:0.115.2-SNAPSHOT -proto-google-cloud-bigquerystorage-v1beta2:0.115.1:0.115.2-SNAPSHOT -proto-google-cloud-bigquerystorage-v1:1.15.1:1.15.2-SNAPSHOT -grpc-google-cloud-bigquerystorage-v1alpha2:0.115.1:0.115.2-SNAPSHOT -grpc-google-cloud-bigquerystorage-v1beta1:0.115.1:0.115.2-SNAPSHOT -grpc-google-cloud-bigquerystorage-v1beta2:0.115.1:0.115.2-SNAPSHOT -grpc-google-cloud-bigquerystorage-v1:1.15.1:1.15.2-SNAPSHOT -google-cloud-bigquerystorage:1.15.1:1.15.2-SNAPSHOT +proto-google-cloud-bigquerystorage-v1alpha2:0.116.0:0.116.0 +proto-google-cloud-bigquerystorage-v1beta1:0.116.0:0.116.0 +proto-google-cloud-bigquerystorage-v1beta2:0.116.0:0.116.0 +proto-google-cloud-bigquerystorage-v1:1.16.0:1.16.0 +grpc-google-cloud-bigquerystorage-v1alpha2:0.116.0:0.116.0 +grpc-google-cloud-bigquerystorage-v1beta1:0.116.0:0.116.0 +grpc-google-cloud-bigquerystorage-v1beta2:0.116.0:0.116.0 +grpc-google-cloud-bigquerystorage-v1:1.16.0:1.16.0 +google-cloud-bigquerystorage:1.16.0:1.16.0