diff --git a/README.md b/README.md
index 1d99e65b8..aceecda14 100644
--- a/README.md
+++ b/README.md
@@ -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.1'
```
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.1"
```
@@ -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.1
[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
diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/SearchStats.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/SearchStats.java
index 73b812383..237b83ca7 100644
--- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/SearchStats.java
+++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/SearchStats.java
@@ -68,7 +68,7 @@ SearchStatistics toPb() {
searchStatistics.setIndexUsageMode(getIndexUsageMode());
}
if (getIndexUnusedReasons() != null) {
- searchStatistics.setIndexUnusedReason(
+ searchStatistics.setIndexUnusedReasons(
getIndexUnusedReasons().stream()
.map(IndexUnusedReason::toPb)
.collect(Collectors.toList()));
@@ -81,9 +81,9 @@ static SearchStats fromPb(SearchStatistics searchStatistics) {
if (searchStatistics.getIndexUsageMode() != null) {
builder.setIndexUsageMode(searchStatistics.getIndexUsageMode());
}
- if (searchStatistics.getIndexUnusedReason() != null) {
+ if (searchStatistics.getIndexUnusedReasons() != null) {
builder.setIndexUnusedReasons(
- searchStatistics.getIndexUnusedReason().stream()
+ searchStatistics.getIndexUnusedReasons().stream()
.map(IndexUnusedReason::fromPb)
.collect(Collectors.toList()));
}
diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java
index 8c5742e57..bb9c233a4 100644
--- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java
+++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java
@@ -5090,7 +5090,7 @@ public void testQueryJobWithLabels() throws InterruptedException, TimeoutExcepti
}
@Test
- public void testQueryJobWithSearchReturnsSearchStatistics() throws InterruptedException {
+ public void testQueryJobWithSearchReturnsSearchStatisticsUnused() throws InterruptedException {
String tableName = "test_query_job_table";
String query =
"SELECT * FROM "
@@ -5109,6 +5109,10 @@ public void testQueryJobWithSearchReturnsSearchStatistics() throws InterruptedEx
JobStatistics.QueryStatistics stats = remoteJob.getStatistics();
assertNotNull(stats.getSearchStats());
assertEquals(stats.getSearchStats().getIndexUsageMode(), "UNUSED");
+ assertNotNull(stats.getSearchStats().getIndexUnusedReasons());
+ assertNotNull(
+ stats.getSearchStats().getIndexUnusedReasons().get(0).getCode(),
+ "INDEX_CONFIG_NOT_AVAILABLE");
} finally {
bigquery.delete(destinationTable);
}
diff --git a/pom.xml b/pom.xml
index cd2a749ed..90bf5b323 100644
--- a/pom.xml
+++ b/pom.xml
@@ -54,7 +54,7 @@
UTF-8
github
google-cloud-bigquery-parent
- v2-rev20230520-2.0.0
+ v2-rev20230805-2.0.0
3.14.0
12.0.1