diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index c1e4d2da2a8..4ca0036da32 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:a57d2ea6d1a77aa96c17ad0850b779ec6295f88b6c1da3d214b2095d140a2066 + digest: sha256:27b1b1884dce60460d7521b23c2a73376cba90c0ef3d9f0d32e4bdb786959cfd diff --git a/.github/release-please.yml b/.github/release-please.yml index d0d8ce428c2..45821c154cf 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -26,3 +26,7 @@ branches: bumpMinorPreMajor: true handleGHRelease: true branch: 6.23.x + - releaseType: java-yoshi + bumpMinorPreMajor: true + handleGHRelease: true + branch: 6.33.x diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 87ddc5b58dc..167e52ec6dc 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -107,6 +107,20 @@ branchProtectionRules: - checkstyle - compile (8) - compile (11) + - pattern: 6.33.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - lint + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - checkstyle + - compile (8) + - compile (11) permissionRules: - team: yoshi-admins permission: admin diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 750b4915792..421141c76be 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -86,6 +86,22 @@ integration) verify RETURN_CODE=$? ;; +integration-staging) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -ntp \ + -Penable-integration-tests \ + -Djava.net.preferIPv4Stack=true \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.main.skip=true \ + -Dspanner.gce.config.server_url=https://staging-wrenchworks.sandbox.googleapis.com \ + -Dspanner.testenv.instance=projects/span-cloud-testing/instances/gaurav-test-instance \ + -Dspanner.gce.config.project_id=span-cloud-testing + -fae \ + verify + RETURN_CODE=$? + ;; graalvm) # Run Unit and Integration Tests with Native Image mvn test -Pnative -Penable-integration-tests diff --git a/.kokoro/nightly/integration-staging.cfg b/.kokoro/nightly/integration-staging.cfg new file mode 100644 index 00000000000..ea89f65a3a6 --- /dev/null +++ b/.kokoro/nightly/integration-staging.cfg @@ -0,0 +1,32 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration-staging" +} +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index a3f7fb9d494..e20330c3ca6 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 4c7225ec924..0fd6ba2fa0c 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.0" } env_vars: { diff --git a/CHANGELOG.md b/CHANGELOG.md index 2131d9423bc..a42cd255d57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [6.34.0](https://github.com/googleapis/java-spanner/compare/v6.33.0...v6.34.0) (2022-12-12) + + +### Features + +* Setting up 6.33.x branch ([#2184](https://github.com/googleapis/java-spanner/issues/2184)) ([e237a21](https://github.com/googleapis/java-spanner/commit/e237a213cf5cb5edc338ca4e5f8ad5dd0593d2d1)) + + +### Bug Fixes + +* Remove the statement of session number limits ([#1928](https://github.com/googleapis/java-spanner/issues/1928)) ([ddd0625](https://github.com/googleapis/java-spanner/commit/ddd062527674659ca2ea73e079bca4dee62ca67f)), closes [#1927](https://github.com/googleapis/java-spanner/issues/1927) +* Update samples/snippets pom.xml configuration to avoid fat jar ([#2100](https://github.com/googleapis/java-spanner/issues/2100)) ([19058b4](https://github.com/googleapis/java-spanner/commit/19058b4cd324ce33e8dd52447bde2486c87d4754)) +* Use a proper endpoint for DirectPath tests ([#2186](https://github.com/googleapis/java-spanner/issues/2186)) ([4d74a0d](https://github.com/googleapis/java-spanner/commit/4d74a0d8ae48e190c126ab4047b81cca117f4de1)) + + +### Dependencies + +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.18 ([#2171](https://github.com/googleapis/java-spanner/issues/2171)) ([f348780](https://github.com/googleapis/java-spanner/commit/f3487805fe5f976596e94047c3796bc623eeae95)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.18 ([#2145](https://github.com/googleapis/java-spanner/issues/2145)) ([dcdd2c3](https://github.com/googleapis/java-spanner/commit/dcdd2c3b684e38892fac0abbdf06081e9c7d83b2)) + ## [6.33.0](https://github.com/googleapis/java-spanner/compare/v6.32.0...v6.33.0) (2022-11-17) diff --git a/README.md b/README.md index fad7a98ef09..3e782b61cae 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.1.4 + 26.1.5 pom import @@ -41,7 +41,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-spanner - 6.32.0 + 6.33.0 ``` @@ -49,20 +49,20 @@ 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:26.1.4') +implementation platform('com.google.cloud:libraries-bom:26.1.5') implementation 'com.google.cloud:google-cloud-spanner' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-spanner:6.32.0' +implementation 'com.google.cloud:google-cloud-spanner:6.33.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.32.0" +libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.33.0" ``` ## Authentication diff --git a/google-cloud-spanner-bom/pom.xml b/google-cloud-spanner-bom/pom.xml index a09ec737bff..ab10695432e 100644 --- a/google-cloud-spanner-bom/pom.xml +++ b/google-cloud-spanner-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner-bom - 6.33.0 + 6.34.0 pom com.google.cloud @@ -53,43 +53,43 @@ com.google.cloud google-cloud-spanner - 6.33.0 + 6.34.0 com.google.cloud google-cloud-spanner test-jar - 6.33.0 + 6.34.0 com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.33.0 + 6.34.0 com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.33.0 + 6.34.0 com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.33.0 + 6.34.0 com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.33.0 + 6.34.0 com.google.api.grpc proto-google-cloud-spanner-v1 - 6.33.0 + 6.34.0 com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.33.0 + 6.34.0 diff --git a/google-cloud-spanner/pom.xml b/google-cloud-spanner/pom.xml index 42c4cbfc818..8f3fd5978c4 100644 --- a/google-cloud-spanner/pom.xml +++ b/google-cloud-spanner/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner - 6.33.0 + 6.34.0 jar Google Cloud Spanner https://github.com/googleapis/java-spanner @@ -11,7 +11,7 @@ com.google.cloud google-cloud-spanner-parent - 6.33.0 + 6.34.0 google-cloud-spanner diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractResultSet.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractResultSet.java index fdbea3335b9..789e0945e17 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractResultSet.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractResultSet.java @@ -67,7 +67,6 @@ import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; -import java.util.stream.Collectors; import javax.annotation.Nullable; /** Implementation of {@link ResultSet}. */ @@ -547,88 +546,24 @@ private static Struct decodeStructValue(Type structType, ListValue structValue) static Object decodeArrayValue(Type elementType, ListValue listValue) { switch (elementType.getCode()) { - case BOOL: - // Use a view: element conversion is virtually free. - return Lists.transform( - listValue.getValuesList(), - input -> input.getKindCase() == KindCase.NULL_VALUE ? null : input.getBoolValue()); case INT64: // For int64/float64 types, use custom containers. These avoid wrapper object // creation for non-null arrays. return new Int64Array(listValue); case FLOAT64: return new Float64Array(listValue); + case BOOL: case NUMERIC: - { - // Materialize list: element conversion is expensive and should happen only once. - ArrayList list = new ArrayList<>(listValue.getValuesCount()); - for (com.google.protobuf.Value value : listValue.getValuesList()) { - list.add( - value.getKindCase() == KindCase.NULL_VALUE - ? null - : new BigDecimal(value.getStringValue())); - } - return list; - } case PG_NUMERIC: case STRING: case JSON: case PG_JSONB: - return listValue.getValuesList().stream() - .map( - input -> - input.getKindCase() == KindCase.NULL_VALUE ? null : input.getStringValue()) - .collect(Collectors.toList()); case BYTES: - { - // Materialize list: element conversion is expensive and should happen only once. - ArrayList list = new ArrayList<>(listValue.getValuesCount()); - for (com.google.protobuf.Value value : listValue.getValuesList()) { - list.add( - value.getKindCase() == KindCase.NULL_VALUE - ? null - : ByteArray.fromBase64(value.getStringValue())); - } - return list; - } case TIMESTAMP: - { - // Materialize list: element conversion is expensive and should happen only once. - ArrayList list = new ArrayList<>(listValue.getValuesCount()); - for (com.google.protobuf.Value value : listValue.getValuesList()) { - list.add( - value.getKindCase() == KindCase.NULL_VALUE - ? null - : Timestamp.parseTimestamp(value.getStringValue())); - } - return list; - } case DATE: - { - // Materialize list: element conversion is expensive and should happen only once. - ArrayList list = new ArrayList<>(listValue.getValuesCount()); - for (com.google.protobuf.Value value : listValue.getValuesList()) { - list.add( - value.getKindCase() == KindCase.NULL_VALUE - ? null - : Date.parseDate(value.getStringValue())); - } - return list; - } - case STRUCT: - { - ArrayList list = new ArrayList<>(listValue.getValuesCount()); - for (com.google.protobuf.Value value : listValue.getValuesList()) { - if (value.getKindCase() == KindCase.NULL_VALUE) { - list.add(null); - } else { - ListValue structValue = value.getListValue(); - list.add(decodeStructValue(elementType, structValue)); - } - } - return list; - } + return Lists.transform( + listValue.getValuesList(), input -> decodeValue(elementType, input)); default: throw new AssertionError("Unhandled type code: " + elementType.getCode()); } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Session.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Session.java index 697521554e9..d322e0fb6d0 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Session.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Session.java @@ -28,10 +28,9 @@ * read-write/write-only transactions, create multiple sessions. Note that standalone reads and * queries use a transaction internally, and count toward the one transaction limit. * - *

Cloud Spanner limits the number of sessions that can exist at any given time; thus, it is a - * good idea to delete idle and/or unneeded sessions. Aside from explicit deletes, Cloud Spanner can - * delete sessions for which no operations are sent for more than an hour, or due to internal - * errors. If a session is deleted, requests to it return {@link ErrorCode#NOT_FOUND}. + *

It is a good idea to delete idle and/or unneeded sessions. Aside from explicit deletes, Cloud + * Spanner can delete sessions for which no operations are sent for more than an hour, or due to + * internal errors. If a session is deleted, requests to it return {@link ErrorCode#NOT_FOUND}. * *

Idle sessions can be kept alive by sending a trivial SQL query periodically, for example, * {@code SELECT 1}. diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/StructReader.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/StructReader.java index a96c95cb953..b767bd6d82c 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/StructReader.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/StructReader.java @@ -178,10 +178,18 @@ default Value getValue(String columnName) { */ boolean[] getBooleanArray(String columnName); - /** Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.bool())}. */ + /** + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.bool())}. The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. + */ List getBooleanList(int columnIndex); - /** Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.bool())}. */ + /** + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.bool())}. The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. + */ List getBooleanList(String columnName); /** @@ -200,10 +208,18 @@ default Value getValue(String columnName) { */ long[] getLongArray(String columnName); - /** Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.int64())}. */ + /** + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.int64())}. The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. + */ List getLongList(int columnIndex); - /** Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.int64())}. */ + /** + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.int64())}. The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. + */ List getLongList(String columnName); /** @@ -223,84 +239,136 @@ default Value getValue(String columnName) { double[] getDoubleArray(String columnName); /** - * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.float64())}. + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.float64())} The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. */ List getDoubleList(int columnIndex); /** - * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.float64())}. + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.float64())} The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. */ List getDoubleList(String columnName); /** - * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.numeric())}. + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.numeric())} The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. */ List getBigDecimalList(int columnIndex); /** - * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.numeric())}. + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.numeric())} The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. */ List getBigDecimalList(String columnName); - /** Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.string())}. */ + /** + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.string())}. The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. + */ List getStringList(int columnIndex); - /** Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.string())}. */ + /** + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.string())}. The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. + */ List getStringList(String columnName); - /** Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.json())}. */ + /** + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.json())}. The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. + */ default List getJsonList(int columnIndex) { throw new UnsupportedOperationException("method should be overwritten"); }; - /** Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.json())}. */ + /** + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.json())}. The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. + */ default List getJsonList(String columnName) { throw new UnsupportedOperationException("method should be overwritten"); }; /** - * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.pgJsonb())}. + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.pgJsonb())} The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. */ default List getPgJsonbList(int columnIndex) { throw new UnsupportedOperationException("method should be overwritten"); }; /** - * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.pgJsonb())}. + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.pgJsonb())} The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. */ default List getPgJsonbList(String columnName) { throw new UnsupportedOperationException("method should be overwritten"); }; - /** Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.bytes())}. */ + /** + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.bytes())}. The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. + */ List getBytesList(int columnIndex); - /** Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.bytes())}. */ + /** + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.bytes())}. The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. + */ List getBytesList(String columnName); /** - * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.timestamp())}. + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.timestamp())} + * The list returned by this method is lazily constructed. Create a copy of it if you intend to + * access each element in the list multiple times. */ List getTimestampList(int columnIndex); /** - * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.timestamp())}. + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.timestamp())} + * The list returned by this method is lazily constructed. Create a copy of it if you intend to + * access each element in the list multiple times. */ List getTimestampList(String columnName); - /** Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.date())}. */ + /** + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.date())}. The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. + */ List getDateList(int columnIndex); - /** Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.date())}. */ + /** + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.date())}. The + * list returned by this method is lazily constructed. Create a copy of it if you intend to access + * each element in the list multiple times. + */ List getDateList(String columnName); /** - * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.struct(...))}. + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.struct(...))} + * The list returned by this method is lazily constructed. Create a copy of it if you intend to + * access each element in the list multiple times. */ List getStructList(int columnIndex); /** - * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.struct(...))}. + * Returns the value of a non-{@code NULL} column with type {@code Type.array(Type.struct(...))} + * The list returned by this method is lazily constructed. Create a copy of it if you intend to + * access each element in the list multiple times. */ List getStructList(String columnName); } diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GceTestEnvConfig.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GceTestEnvConfig.java index ab8e3933f9f..7a27123bdc3 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GceTestEnvConfig.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GceTestEnvConfig.java @@ -53,7 +53,7 @@ public class GceTestEnvConfig implements TestEnvConfig { public static final String DP_IPV6_PREFIX = "2001:4860:8040"; public static final String DP_IPV4_PREFIX = "34.126"; - private static final String DIRECT_PATH_ENDPOINT = "aa423245250f2bbf.sandbox.googleapis.com:443"; + private static final String DIRECT_PATH_ENDPOINT = "wrenchworks-nonprod.googleapis.com:443"; private final SpannerOptions options; diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java index 340f999d8ee..29ab79450b5 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java @@ -1289,7 +1289,11 @@ private Statement buildStatement( builder.bind(fieldName).toTimestampArray(null); break; case JSON: - builder.bind(fieldName).toJsonArray(null); + if (elementType.getTypeAnnotation() == TypeAnnotationCode.PG_JSONB) { + builder.bind(fieldName).toPgJsonbArray(null); + } else { + builder.bind(fieldName).toJsonArray(null); + } break; case STRUCT: case TYPE_CODE_UNSPECIFIED: @@ -1331,7 +1335,11 @@ private Statement buildStatement( builder.bind(fieldName).to((com.google.cloud.Timestamp) null); break; case JSON: - builder.bind(fieldName).to(Value.json(null)); + if (fieldType.getTypeAnnotation() == TypeAnnotationCode.PG_JSONB) { + builder.bind(fieldName).to(Value.pgJsonb(null)); + } else { + builder.bind(fieldName).to(Value.json(null)); + } break; case TYPE_CODE_UNSPECIFIED: case UNRECOGNIZED: @@ -1416,12 +1424,21 @@ private Statement buildStatement( com.google.cloud.spanner.Type.timestamp(), value.getListValue())); break; case JSON: - builder - .bind(fieldName) - .toJsonArray( - (Iterable) - GrpcStruct.decodeArrayValue( - com.google.cloud.spanner.Type.json(), value.getListValue())); + if (elementType.getTypeAnnotation() == TypeAnnotationCode.PG_JSONB) { + builder + .bind(fieldName) + .toPgJsonbArray( + (Iterable) + GrpcStruct.decodeArrayValue( + com.google.cloud.spanner.Type.pgJsonb(), value.getListValue())); + } else { + builder + .bind(fieldName) + .toJsonArray( + (Iterable) + GrpcStruct.decodeArrayValue( + com.google.cloud.spanner.Type.json(), value.getListValue())); + } break; case STRUCT: case TYPE_CODE_UNSPECIFIED: @@ -1464,7 +1481,11 @@ private Statement buildStatement( .to(com.google.cloud.Timestamp.parseTimestamp(value.getStringValue())); break; case JSON: - builder.bind(fieldName).to(Value.json(value.getStringValue())); + if (fieldType.getTypeAnnotation() == TypeAnnotationCode.PG_JSONB) { + builder.bind(fieldName).to(Value.pgJsonb(value.getStringValue())); + } else { + builder.bind(fieldName).to(Value.json(value.getStringValue())); + } break; case TYPE_CODE_UNSPECIFIED: case UNRECOGNIZED: diff --git a/grpc-google-cloud-spanner-admin-database-v1/pom.xml b/grpc-google-cloud-spanner-admin-database-v1/pom.xml index 2f66ddb18fb..291ea157c3a 100644 --- a/grpc-google-cloud-spanner-admin-database-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.33.0 + 6.34.0 grpc-google-cloud-spanner-admin-database-v1 GRPC library for grpc-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.33.0 + 6.34.0 diff --git a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml index 9163309605b..fae6478c7a8 100644 --- a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.33.0 + 6.34.0 grpc-google-cloud-spanner-admin-instance-v1 GRPC library for grpc-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.33.0 + 6.34.0 diff --git a/grpc-google-cloud-spanner-v1/pom.xml b/grpc-google-cloud-spanner-v1/pom.xml index fe0f0837d2d..b898649cf39 100644 --- a/grpc-google-cloud-spanner-v1/pom.xml +++ b/grpc-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.33.0 + 6.34.0 grpc-google-cloud-spanner-v1 GRPC library for grpc-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.33.0 + 6.34.0 diff --git a/pom.xml b/pom.xml index 74134a3e62a..652d8d9fd44 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-spanner-parent pom - 6.33.0 + 6.34.0 Google Cloud Spanner Parent https://github.com/googleapis/java-spanner @@ -62,37 +62,37 @@ com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.33.0 + 6.34.0 com.google.api.grpc proto-google-cloud-spanner-v1 - 6.33.0 + 6.34.0 com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.33.0 + 6.34.0 com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.33.0 + 6.34.0 com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.33.0 + 6.34.0 com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.33.0 + 6.34.0 com.google.cloud google-cloud-spanner - 6.33.0 + 6.34.0 diff --git a/proto-google-cloud-spanner-admin-database-v1/pom.xml b/proto-google-cloud-spanner-admin-database-v1/pom.xml index b6d688336b7..fa7c95abd5f 100644 --- a/proto-google-cloud-spanner-admin-database-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.33.0 + 6.34.0 proto-google-cloud-spanner-admin-database-v1 PROTO library for proto-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.33.0 + 6.34.0 diff --git a/proto-google-cloud-spanner-admin-instance-v1/pom.xml b/proto-google-cloud-spanner-admin-instance-v1/pom.xml index e615a5a5366..fd5ab4f350d 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.33.0 + 6.34.0 proto-google-cloud-spanner-admin-instance-v1 PROTO library for proto-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.33.0 + 6.34.0 diff --git a/proto-google-cloud-spanner-v1/pom.xml b/proto-google-cloud-spanner-v1/pom.xml index 9f44563ec73..28743a2a639 100644 --- a/proto-google-cloud-spanner-v1/pom.xml +++ b/proto-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-v1 - 6.33.0 + 6.34.0 proto-google-cloud-spanner-v1 PROTO library for proto-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.33.0 + 6.34.0 diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 6fe651c6e93..6c96e112de5 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -32,7 +32,7 @@ com.google.cloud google-cloud-spanner - 6.32.0 + 6.33.0 diff --git a/samples/native-image/pom.xml b/samples/native-image/pom.xml index 0391300694f..f134552ae5a 100644 --- a/samples/native-image/pom.xml +++ b/samples/native-image/pom.xml @@ -28,7 +28,7 @@ com.google.cloud libraries-bom - 26.1.4 + 26.1.5 pom import @@ -109,7 +109,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.17 + 0.9.18 test @@ -130,7 +130,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.16 + 0.9.18 true com.example.spanner.NativeImageSpannerSample diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 554bafaed14..e4844a745b1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -31,7 +31,7 @@ com.google.cloud google-cloud-spanner - 6.33.0 + 6.34.0 diff --git a/samples/snippets/assembly-descriptor.xml b/samples/snippets/assembly-descriptor.xml deleted file mode 100644 index 8a9e7f8f500..00000000000 --- a/samples/snippets/assembly-descriptor.xml +++ /dev/null @@ -1,27 +0,0 @@ - - jar-with-dependencies - - jar - - false - - - / - false - true - - - io.grpc.LoadBalancerProvider - - - - - - - ${project.build.outputDirectory} - . - - - diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 39061fea820..79b88560263 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -33,7 +33,7 @@ com.google.cloud libraries-bom - 26.1.4 + 26.1.5 pom import @@ -115,30 +115,61 @@ - spanner-google-cloud-samples - maven-assembly-plugin - 3.4.2 + maven-resources-plugin + + + copy-resources + validate + + copy-resources + + + ${project.build.directory}/spanner-snippets + + + resources + true + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + prepare-package + + copy-dependencies + + + ${project.build.directory}/spanner-snippets/lib + false + false + true + + + + + + org.apache.maven.plugins + maven-jar-plugin - - assembly-descriptor.xml - + spanner-snippets/spanner-google-cloud-samples + false com.example.spanner.SpannerSample + true + lib/ - - - make-assembly - package - - single - - - org.apache.maven.plugins diff --git a/versions.txt b/versions.txt index 038bb96ac5b..6dc1e7ccffd 100644 --- a/versions.txt +++ b/versions.txt @@ -1,10 +1,10 @@ # Format: # module:released-version:current-version -proto-google-cloud-spanner-admin-instance-v1:6.33.0:6.33.0 -proto-google-cloud-spanner-v1:6.33.0:6.33.0 -proto-google-cloud-spanner-admin-database-v1:6.33.0:6.33.0 -grpc-google-cloud-spanner-v1:6.33.0:6.33.0 -grpc-google-cloud-spanner-admin-instance-v1:6.33.0:6.33.0 -grpc-google-cloud-spanner-admin-database-v1:6.33.0:6.33.0 -google-cloud-spanner:6.33.0:6.33.0 +proto-google-cloud-spanner-admin-instance-v1:6.34.0:6.34.0 +proto-google-cloud-spanner-v1:6.34.0:6.34.0 +proto-google-cloud-spanner-admin-database-v1:6.34.0:6.34.0 +grpc-google-cloud-spanner-v1:6.34.0:6.34.0 +grpc-google-cloud-spanner-admin-instance-v1:6.34.0:6.34.0 +grpc-google-cloud-spanner-admin-database-v1:6.34.0:6.34.0 +google-cloud-spanner:6.34.0:6.34.0