Skip to content

Commit

Permalink
Refactor BasePolarisCatalog to use Iceberg's BadRequestException inst…
Browse files Browse the repository at this point in the history
…ead of jakarta (#323)

It looks like the jakarta flavor inadvertently got added by someone's IDE and now
there's a needless mix of jakarta/iceberg BadRequestException
  • Loading branch information
dennishuo authored Sep 26, 2024
1 parent 2f53f77 commit 2608f4d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import jakarta.ws.rs.BadRequestException;
import java.io.Closeable;
import java.io.IOException;
import java.net.URI;
Expand Down Expand Up @@ -53,6 +52,7 @@
import org.apache.iceberg.catalog.SupportsNamespaces;
import org.apache.iceberg.catalog.TableIdentifier;
import org.apache.iceberg.exceptions.AlreadyExistsException;
import org.apache.iceberg.exceptions.BadRequestException;
import org.apache.iceberg.exceptions.CommitFailedException;
import org.apache.iceberg.exceptions.ForbiddenException;
import org.apache.iceberg.exceptions.NamespaceNotEmptyException;
Expand Down Expand Up @@ -1403,7 +1403,7 @@ private void validateMetadataFileInTableDir(
if (!isUnderParentLocation(
URI.create(metadata.metadataFileLocation()),
URI.create(metadata.location() + "/metadata").normalize())) {
throw new org.apache.iceberg.exceptions.BadRequestException(
throw new BadRequestException(
"Metadata location %s is not allowed outside of table location %s",
metadata.metadataFileLocation(), metadata.location());
}
Expand Down Expand Up @@ -1708,7 +1708,7 @@ private void renameTableLike(

// some entities cannot be renamed
case PolarisMetaStoreManager.ReturnStatus.ENTITY_CANNOT_BE_RENAMED:
throw new BadRequestException("Cannot rename built-in object " + leafEntity.getName());
throw new BadRequestException("Cannot rename built-in object %s", leafEntity.getName());

// some entities cannot be renamed
default:
Expand Down

0 comments on commit 2608f4d

Please sign in to comment.