Skip to content

Commit

Permalink
AWS, Core, Nessie: Expose catalog properties (apache#6471)
Browse files Browse the repository at this point in the history
  • Loading branch information
nastra authored Dec 21, 2022
1 parent 3e28b55 commit e3a7b16
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,13 @@ public class DynamoDbCatalog extends BaseMetastoreCatalog
private AwsProperties awsProperties;
private FileIO fileIO;
private CloseableGroup closeableGroup;
private Map<String, String> catalogProperties;

public DynamoDbCatalog() {}

@Override
public void initialize(String name, Map<String, String> properties) {
this.catalogProperties = ImmutableMap.copyOf(properties);
initialize(
name,
properties.get(CatalogProperties.WAREHOUSE_LOCATION),
Expand Down Expand Up @@ -686,4 +688,9 @@ private boolean updateProperties(
return false;
}
}

@Override
protected Map<String, String> properties() {
return catalogProperties == null ? ImmutableMap.of() : catalogProperties;
}
}
5 changes: 5 additions & 0 deletions core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java
Original file line number Diff line number Diff line change
Expand Up @@ -588,4 +588,9 @@ private boolean deleteProperties(Namespace namespace, Set<String> properties) {

return execute(JdbcUtil.deletePropertiesStatement(properties), args) > 0;
}

@Override
protected Map<String, String> properties() {
return catalogProperties == null ? ImmutableMap.of() : catalogProperties;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.apache.iceberg.io.CloseableGroup;
import org.apache.iceberg.io.FileIO;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
import org.apache.iceberg.relocated.com.google.common.collect.Lists;
import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
import org.apache.iceberg.util.LocationUtil;
Expand Down Expand Up @@ -84,6 +85,7 @@ public class EcsCatalog extends BaseMetastoreCatalog

private FileIO fileIO;
private CloseableGroup closeableGroup;
private Map<String, String> catalogProperties;

/**
* No-arg constructor to load the catalog dynamically.
Expand All @@ -94,6 +96,7 @@ public EcsCatalog() {}

@Override
public void initialize(String name, Map<String, String> properties) {
this.catalogProperties = ImmutableMap.copyOf(properties);
String inputWarehouseLocation = properties.get(CatalogProperties.WAREHOUSE_LOCATION);
Preconditions.checkArgument(
inputWarehouseLocation != null && inputWarehouseLocation.length() > 0,
Expand Down Expand Up @@ -495,4 +498,9 @@ public void close() throws IOException {
public void setConf(Object conf) {
this.hadoopConf = conf;
}

@Override
protected Map<String, String> properties() {
return catalogProperties == null ? ImmutableMap.of() : catalogProperties;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -331,4 +331,9 @@ private TableIdentifier identifierWithoutTableReference(
}
return identifier;
}

@Override
protected Map<String, String> properties() {
return catalogOptions == null ? ImmutableMap.of() : catalogOptions;
}
}

0 comments on commit e3a7b16

Please sign in to comment.