Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/dot-kokoro/cryptography-41.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeddada1 authored Sep 14, 2023
2 parents 239ba73 + 902e9b9 commit 43397a5
Show file tree
Hide file tree
Showing 27 changed files with 472 additions and 45 deletions.
4 changes: 2 additions & 2 deletions .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
digest: sha256:46d2d262cd285c638656c8bde468011b723dc0c7ffd6a5ecc2650fe639c82e8f
# created: 2023-07-24T14:21:17.707234503Z
digest: sha256:88ba8dcc5c2c7792e1c3511381f4ab329002a1c42c512f66ca87ced572dfbf9f
# created: 2023-09-05T18:54:42.225408832Z
1 change: 1 addition & 0 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ branchProtectionRules:
- 'Kokoro - Test: Integration'
- cla/google
- OwlBot Post Processor
- javadoc
- pattern: 1.127.12-sp
isAdminEnforced: true
requiredApprovingReviewCount: 1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
persist-credentials: false

Expand All @@ -59,7 +59,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: SARIF file
path: results.sarif
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ __pycache__
.new-list.txt
.org-list.txt
SimpleBenchmarkApp/src/main/java/com/google/cloud/App.java
.flattened-pom.xml
.flattened-pom.xml
# Local Test files
*ITLocalTest.java
9 changes: 4 additions & 5 deletions .kokoro/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ cachetools==5.3.1 \
--hash=sha256:95ef631eeaea14ba2e36f06437f36463aac3a096799e876ee55e5cdccb102590 \
--hash=sha256:dce83f2d9b4e1f732a8cd44af8e8fab2dbe46201467fc98b3ef8f269092bf62b
# via google-auth
certifi==2023.5.7 \
--hash=sha256:0f0d56dc5a6ad56fd4ba36484d6cc34451e1c6548c61daad8c320169f91eddc7 \
--hash=sha256:c6c2e98f5c7869efca1f8916fed228dd91539f9f1b444c314c06eef02980c716
certifi==2023.7.22 \
--hash=sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082 \
--hash=sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9
# via requests
cffi==1.15.1 \
--hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \
Expand Down Expand Up @@ -485,6 +485,5 @@ zipp==3.16.1 \
# via importlib-metadata

# WARNING: The following packages were not pinned, but pip requires them to be
# pinned when the requirements file includes hashes and the requirement is not
# satisfied by a package already installed. Consider using the --allow-unsafe flag.
# pinned when the requirements file includes hashes. Consider using the --allow-unsafe flag.
# setuptools
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## [2.31.2](https://github.com/googleapis/java-bigquery/compare/v2.31.1...v2.31.2) (2023-09-05)


### Bug Fixes

* Hide TableReference data struct ([#2855](https://github.com/googleapis/java-bigquery/issues/2855)) ([2cbded6](https://github.com/googleapis/java-bigquery/commit/2cbded6600af1de8ec15b04a2496733ad2b50c47))
* SearchStats IndexUnusedReasons null bug ([#2825](https://github.com/googleapis/java-bigquery/issues/2825)) ([309ea60](https://github.com/googleapis/java-bigquery/commit/309ea607a9ff50e59dc4e1069c689c1da9605ed5))

## [2.31.1](https://github.com/googleapis/java-bigquery/compare/v2.31.0...v2.31.1) (2023-08-09)


### Dependencies

* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.25.0 ([#2845](https://github.com/googleapis/java-bigquery/issues/2845)) ([d940f8d](https://github.com/googleapis/java-bigquery/commit/d940f8d7f119d75aaa80eb60babd5406fca76c69))
* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.29.0 ([#2846](https://github.com/googleapis/java-bigquery/issues/2846)) ([87a0a10](https://github.com/googleapis/java-bigquery/commit/87a0a10d806fdcbf4bdb1ee1478b9ee6aeb7b287))
* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.14.0 ([#2834](https://github.com/googleapis/java-bigquery/issues/2834)) ([79fe14c](https://github.com/googleapis/java-bigquery/commit/79fe14c08836b40bf84775a526cba32f63dd8227))
* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.24 ([#2839](https://github.com/googleapis/java-bigquery/issues/2839)) ([ae752bc](https://github.com/googleapis/java-bigquery/commit/ae752bc36c516e1a4172bc0c9cfa7ed6bbcbe0e7))
* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.24 ([#2840](https://github.com/googleapis/java-bigquery/issues/2840)) ([1ae6cb9](https://github.com/googleapis/java-bigquery/commit/1ae6cb9b20152e00db9a559ff143faca581bf8b1))
* Update github/codeql-action action to v2.21.1 ([#2824](https://github.com/googleapis/java-bigquery/issues/2824)) ([9978971](https://github.com/googleapis/java-bigquery/commit/997897166ba121256b7fa6f4c63f83daebdc6a54))
* Update jmh.version to v1.37 ([#2836](https://github.com/googleapis/java-bigquery/issues/2836)) ([4b3a3c2](https://github.com/googleapis/java-bigquery/commit/4b3a3c22985c76f7e861341dc76e96abc970eaec))

## [2.31.0](https://github.com/googleapis/java-bigquery/compare/v2.30.1...v2.31.0) (2023-07-25)


Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ If you are using Maven without the 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.21.0')
implementation platform('com.google.cloud:libraries-bom:26.22.0')
implementation 'com.google.cloud:google-cloud-bigquery'
```
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-bigquery:2.31.0'
implementation 'com.google.cloud:google-cloud-bigquery:2.31.2'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.31.0"
libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.31.2"
```
<!-- {x-version-update-end} -->

Expand Down Expand Up @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.31.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.31.2
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
4 changes: 2 additions & 2 deletions benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<parent>
<artifactId>google-cloud-bigquery-parent</artifactId>
<groupId>com.google.cloud</groupId>
<version>2.31.0</version><!-- {x-version-update:google-cloud-bigquery:current} -->
<version>2.31.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquery:current} -->
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jmh.version>1.36</jmh.version>
<jmh.version>1.37</jmh.version>
<uberjar.name>benchmark</uberjar.name>
</properties>

Expand Down
15 changes: 15 additions & 0 deletions google-cloud-bigquery/clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,19 @@
<className>com/google/cloud/bigquery/TableInfo*</className>
<method>*TableConstraints(*)</method>
</difference>
<difference>
<differenceType>7013</differenceType>
<className>com/google/cloud/bigquery/IndexUnusedReason*</className>
<method>*BaseTableId(*)</method>
</difference>
<difference>
<differenceType>7002</differenceType>
<className>com/google/cloud/bigquery/IndexUnusedReason*</className>
<method>*BaseTable(*)</method>
</difference>
<difference>
<differenceType>7013</differenceType>
<className>com/google/cloud/bigquery/DatasetInfo*</className>
<method>*setExternalDatasetReference(*)</method>
</difference>
</differences>
4 changes: 2 additions & 2 deletions google-cloud-bigquery/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigquery</artifactId>
<version>2.31.0</version><!-- {x-version-update:google-cloud-bigquery:current} -->
<version>2.31.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquery:current} -->
<packaging>jar</packaging>
<name>BigQuery</name>
<url>https://github.com/googleapis/java-bigquery</url>
<description>BigQuery</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigquery-parent</artifactId>
<version>2.31.0</version><!-- {x-version-update:google-cloud-bigquery:current} -->
<version>2.31.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquery:current} -->
</parent>
<properties>
<site.installationModule>google-cloud-bigquery</site.installationModule>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ public Builder setDefaultCollation(String defaultCollation) {
return this;
}

@Override
public Builder setExternalDatasetReference(ExternalDatasetReference externalDatasetReference) {
infoBuilder.setExternalDatasetReference(externalDatasetReference);
return this;
}

@Override
public Dataset build() {
return new Dataset(bigquery, infoBuilder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public Dataset apply(DatasetInfo datasetInfo) {
private final EncryptionConfiguration defaultEncryptionConfiguration;
private final Long defaultPartitionExpirationMs;
private final String defaultCollation;
private final ExternalDatasetReference externalDatasetReference;

/** A builder for {@code DatasetInfo} objects. */
public abstract static class Builder {
Expand Down Expand Up @@ -127,6 +128,13 @@ public abstract static class Builder {

public abstract Builder setLabels(Map<String, String> labels);

/**
* Optional. Information about the external metadata storage where the dataset is defined.
* Filled out when the dataset type is EXTERNAL
*/
public abstract Builder setExternalDatasetReference(
ExternalDatasetReference externalDatasetReference);

/**
* The default encryption key for all tables in the dataset. Once this property is set, all
* newly-created partitioned tables in the dataset will have encryption key set to this value,
Expand Down Expand Up @@ -183,6 +191,7 @@ static final class BuilderImpl extends Builder {
private EncryptionConfiguration defaultEncryptionConfiguration;
private Long defaultPartitionExpirationMs;
private String defaultCollation;
private ExternalDatasetReference externalDatasetReference;

BuilderImpl() {}

Expand All @@ -202,6 +211,7 @@ static final class BuilderImpl extends Builder {
this.defaultEncryptionConfiguration = datasetInfo.defaultEncryptionConfiguration;
this.defaultPartitionExpirationMs = datasetInfo.defaultPartitionExpirationMs;
this.defaultCollation = datasetInfo.defaultCollation;
this.externalDatasetReference = datasetInfo.externalDatasetReference;
}

BuilderImpl(com.google.api.services.bigquery.model.Dataset datasetPb) {
Expand Down Expand Up @@ -236,6 +246,10 @@ public Acl apply(Dataset.Access accessPb) {
}
this.defaultPartitionExpirationMs = datasetPb.getDefaultPartitionExpirationMs();
this.defaultCollation = datasetPb.getDefaultCollation();
if (datasetPb.getExternalDatasetReference() != null) {
this.externalDatasetReference =
ExternalDatasetReference.fromPb(datasetPb.getExternalDatasetReference());
}
}

@Override
Expand Down Expand Up @@ -336,6 +350,12 @@ public Builder setDefaultCollation(String defaultCollation) {
return this;
}

@Override
public Builder setExternalDatasetReference(ExternalDatasetReference externalDatasetReference) {
this.externalDatasetReference = externalDatasetReference;
return this;
}

@Override
public DatasetInfo build() {
return new DatasetInfo(this);
Expand All @@ -358,6 +378,7 @@ public DatasetInfo build() {
defaultEncryptionConfiguration = builder.defaultEncryptionConfiguration;
defaultPartitionExpirationMs = builder.defaultPartitionExpirationMs;
defaultCollation = builder.defaultCollation;
externalDatasetReference = builder.externalDatasetReference;
}

/** Returns the dataset identity. */
Expand Down Expand Up @@ -487,6 +508,14 @@ public String getDefaultCollation() {
return defaultCollation;
}

/**
* Returns information about the external metadata storage where the dataset is defined. Filled
* out when the dataset type is EXTERNAL.
*/
public ExternalDatasetReference getExternalDatasetReference() {
return externalDatasetReference;
}

/** Returns a builder for the dataset object. */
public Builder toBuilder() {
return new BuilderImpl(this);
Expand All @@ -510,6 +539,7 @@ public String toString() {
.add("defaultEncryptionConfiguration", defaultEncryptionConfiguration)
.add("defaultPartitionExpirationMs", defaultPartitionExpirationMs)
.add("defaultCollation", defaultCollation)
.add("externalDatasetReference", externalDatasetReference)
.toString();
}

Expand Down Expand Up @@ -588,6 +618,9 @@ public Dataset.Access apply(Acl acl) {
if (defaultCollation != null) {
datasetPb.setDefaultCollation(defaultCollation);
}
if (externalDatasetReference != null) {
datasetPb.setExternalDatasetReference(externalDatasetReference.toPb());
}
return datasetPb;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* Copyright 2023 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;

import com.google.auto.value.AutoValue;
import com.google.common.annotations.VisibleForTesting;
import java.io.Serializable;
import javax.annotation.Nullable;

/** Configures the access a dataset defined in an external metadata storage. */
@AutoValue
public abstract class ExternalDatasetReference implements Serializable {

public static ExternalDatasetReference.Builder newBuilder() {
return new AutoValue_ExternalDatasetReference.Builder();
}

static ExternalDatasetReference fromPb(
com.google.api.services.bigquery.model.ExternalDatasetReference externalDatasetReference) {
ExternalDatasetReference.Builder builder = newBuilder();

if (externalDatasetReference.getConnection() != null) {
builder.setConnection(externalDatasetReference.getConnection());
}
if (externalDatasetReference.getExternalSource() != null) {
builder.setExternalSource(externalDatasetReference.getExternalSource());
}

return builder.build();
}

public com.google.api.services.bigquery.model.ExternalDatasetReference toPb() {
com.google.api.services.bigquery.model.ExternalDatasetReference externalDatasetReference =
new com.google.api.services.bigquery.model.ExternalDatasetReference();

externalDatasetReference.setConnection(getConnection());
externalDatasetReference.setExternalSource(getExternalSource());
return externalDatasetReference;
}

@Nullable
public abstract String getConnection();

@Nullable
public abstract String getExternalSource();

/** Returns a builder for an ExternalDatasetReference. */
@VisibleForTesting
public abstract ExternalDatasetReference.Builder toBuilder();

@AutoValue.Builder
public abstract static class Builder {
/**
* The connection id that is used to access the external_source. Format:
* projects/{project_id}/locations/{location_id}/connections/{connection_id} *
*/
public abstract ExternalDatasetReference.Builder setConnection(String connection);

/** External source that backs this dataset * */
public abstract ExternalDatasetReference.Builder setExternalSource(String externalSource);

/** Creates a {@code ExternalDatasetReference} object. */
public abstract ExternalDatasetReference build();
}
}
Loading

0 comments on commit 43397a5

Please sign in to comment.