Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-maynard committed Sep 9, 2024
1 parent 585174c commit b233a50
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1304,10 +1304,7 @@ public void doCommit(TableMetadata base, TableMetadata metadata) {
dataLocations.forEach(
location ->
validateNoLocationOverlap(
catalogEntity,
tableIdentifier,
resolvedNamespace,
location));
catalogEntity, tableIdentifier, resolvedNamespace, location));
// and that the metadata file points to a location within the table's directory structure
if (metadata.metadataFileLocation() != null) {
validateMetadataFileInTableDir(tableIdentifier, metadata, catalog);
Expand Down Expand Up @@ -1521,10 +1518,7 @@ public void doCommit(ViewMetadata base, ViewMetadata metadata) {
// for the storage configuration inherited under this entity's path.
validateLocationForTableLike(identifier, metadata.location(), resolvedStorageEntity);
validateNoLocationOverlap(
catalogEntity,
identifier,
resolvedNamespace,
metadata.location());
catalogEntity, identifier, resolvedNamespace, metadata.location());
}

Map<String, String> tableProperties = new HashMap<>(metadata.properties());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,15 @@ public void setup(PolarisConnectionExtension.PolarisToken adminToken) {
defaultCatalog.catalog = String.format("default_catalog_%s", UUID.randomUUID().toString());
laxCatalog.catalog = String.format("lax_catalog_%s", UUID.randomUUID().toString());
strictCatalog.catalog = String.format("strict_catalog_%s", UUID.randomUUID().toString());
for (var EXT: List.of(BASE_EXT, LAX_EXT)) {
for (var EXT : List.of(BASE_EXT, LAX_EXT)) {
for (var c : List.of(defaultCatalog, laxCatalog, strictCatalog)) {
CatalogProperties.Builder propertiesBuilder =
CatalogProperties.builder()
.setDefaultBaseLocation(String.format("%s/%s", baseLocation, c));
if (!c.equals(defaultCatalog)) {
propertiesBuilder
.addProperty(
PolarisConfiguration.ALLOW_UNSTRUCTURED_TABLE_LOCATION
.catalogConfig(),
PolarisConfiguration.ALLOW_UNSTRUCTURED_TABLE_LOCATION.catalogConfig(),
String.valueOf(c.equals(laxCatalog)))
.addProperty(
PolarisConfiguration.ALLOW_TABLE_LOCATION_OVERLAP.catalogConfig(),
Expand All @@ -170,8 +169,8 @@ public void setup(PolarisConnectionExtension.PolarisToken adminToken) {
1,
config);
try (Response response =
request(EXT, "management/v1/catalogs")
.post(Entity.json(new CreateCatalogRequest(catalogObject)))) {
request(EXT, "management/v1/catalogs")
.post(Entity.json(new CreateCatalogRequest(catalogObject)))) {
if (response.getStatus() != Response.Status.CREATED.getStatusCode()) {
throw new IllegalStateException(
"Failed to create catalog: " + response.readEntity(String.class));
Expand All @@ -180,12 +179,10 @@ public void setup(PolarisConnectionExtension.PolarisToken adminToken) {

namespace = "ns";
CreateNamespaceRequest createNamespaceRequest =
CreateNamespaceRequest.builder()
.withNamespace(Namespace.of(namespace))
.build();
CreateNamespaceRequest.builder().withNamespace(Namespace.of(namespace)).build();
try (Response response =
request(EXT, String.format("catalog/v1/%s/namespaces", c))
.post(Entity.json(createNamespaceRequest))) {
request(EXT, String.format("catalog/v1/%s/namespaces", c))
.post(Entity.json(createNamespaceRequest))) {
if (response.getStatus() != Response.Status.OK.getStatusCode()) {
throw new IllegalStateException(
"Failed to create namespace: " + response.readEntity(String.class));
Expand Down

0 comments on commit b233a50

Please sign in to comment.