You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by et...@apache.org on 2026/07/27 09:24:34 UTC

(iceberg) branch main updated: BigQuery: Convert statement switch to arrow switch (#17381)

This is an automated email from the ASF dual-hosted git repository.

nastra pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/main by this push:
     new 60975ecd8d BigQuery: Convert statement switch to arrow switch (#17381)
60975ecd8d is described below

commit 60975ecd8d9352cfe62448dd59915b7d7bd57011
Author: Uros Bojanic <22...@users.noreply.github.com>
AuthorDate: Mon Jul 27 11:24:28 2026 +0200

    BigQuery: Convert statement switch to arrow switch (#17381)
---
 .../gcp/bigquery/BigQueryMetastoreClientImpl.java  | 36 +++++++++++-----------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreClientImpl.java b/bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreClientImpl.java
index 0e09226284..a878023680 100644
--- a/bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreClientImpl.java
+++ b/bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreClientImpl.java
@@ -631,10 +631,10 @@ public final class BigQueryMetastoreClientImpl implements BigQueryMetastoreClien
             + (exception.getContent() != null ? "\n" + exception.getContent() : "");
 
     switch (response.getStatusCode()) {
-      case HttpStatusCodes.STATUS_CODE_UNAUTHORIZED:
-        throw new NotAuthorizedException(
-            "Not authorized to call the BigQuery API or access this resource: %s", errorMessage);
-      case HttpStatusCodes.STATUS_CODE_BAD_REQUEST:
+      case HttpStatusCodes.STATUS_CODE_UNAUTHORIZED ->
+          throw new NotAuthorizedException(
+              "Not authorized to call the BigQuery API or access this resource: %s", errorMessage);
+      case HttpStatusCodes.STATUS_CODE_BAD_REQUEST -> {
         GoogleJsonError errorDetails = exception.getDetails();
         if (errorDetails != null) {
           List<GoogleJsonError.ErrorInfo> errors = errorDetails.getErrors();
@@ -647,20 +647,20 @@ public final class BigQueryMetastoreClientImpl implements BigQueryMetastoreClien
           }
         }
         throw new BadRequestException("%s", errorMessage);
-      case HttpStatusCodes.STATUS_CODE_FORBIDDEN:
-        throw new ForbiddenException("%s", errorMessage);
-      case HttpStatusCodes.STATUS_CODE_PRECONDITION_FAILED:
-        throw new CommitFailedException("%s", errorMessage);
-      case HttpStatusCodes.STATUS_CODE_NOT_FOUND:
-        throw new IllegalArgumentException(errorMessage);
-      case HttpStatusCodes.STATUS_CODE_SERVER_ERROR:
-        throw new ServiceFailureException("%s", errorMessage);
-      case HttpStatusCodes.STATUS_CODE_SERVICE_UNAVAILABLE:
-        throw new ServiceUnavailableException("%s", errorMessage);
-      case HttpStatusCodes.STATUS_CODE_CONFLICT:
-        throw new AlreadyExistsException("%s", errorMessage);
-      default:
-        throw new HttpResponseException(response);
+      }
+      case HttpStatusCodes.STATUS_CODE_FORBIDDEN ->
+          throw new ForbiddenException("%s", errorMessage);
+      case HttpStatusCodes.STATUS_CODE_PRECONDITION_FAILED ->
+          throw new CommitFailedException("%s", errorMessage);
+      case HttpStatusCodes.STATUS_CODE_NOT_FOUND ->
+          throw new IllegalArgumentException(errorMessage);
+      case HttpStatusCodes.STATUS_CODE_SERVER_ERROR ->
+          throw new ServiceFailureException("%s", errorMessage);
+      case HttpStatusCodes.STATUS_CODE_SERVICE_UNAVAILABLE ->
+          throw new ServiceUnavailableException("%s", errorMessage);
+      case HttpStatusCodes.STATUS_CODE_CONFLICT ->
+          throw new AlreadyExistsException("%s", errorMessage);
+      default -> throw new HttpResponseException(response);
     }
   }