Skip to content

Commit

Permalink
[#446] feat(iceberg): Support detailed iceberg catalog property metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
yunqing-wei committed Oct 13, 2023
1 parent 62746b0 commit 87c6445
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.datastrato.graviton.utils.MapUtils;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -87,12 +88,13 @@ public IcebergCatalogOperations(CatalogEntity entity) {
*/
@Override
public void initialize(Map<String, String> conf) throws RuntimeException {
Map<String, String> config = Maps.newHashMap(conf);
Map<String, String> prefixMap = MapUtils.getPrefixMap(conf, CATALOG_BYPASS_PREFIX);
conf.putAll(prefixMap);
config.putAll(prefixMap);

this.icebergCatalogPropertiesMetadata = new IcebergCatalogPropertiesMetadata();
Map<String, String> resultConf =
this.icebergCatalogPropertiesMetadata.transformProperties(conf);
this.icebergCatalogPropertiesMetadata.transformProperties(config);

IcebergConfig icebergConfig = new IcebergConfig();
icebergConfig.loadFromMap(resultConf, k -> true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -57,7 +58,9 @@ public class IcebergCatalogPropertiesMetadata extends BaseCatalogPropertiesMetad
stringRequiredPropertyEntry(URI, "Iceberg catalog uri config", false, false),
stringRequiredPropertyEntry(
WAREHOUSE, "Iceberg catalog warehouse config", false, false));
PROPERTIES_METADATA = Maps.uniqueIndex(propertyEntries, PropertyEntry::getName);
HashMap<String, PropertyEntry<?>> result = Maps.newHashMap(BASIC_CATALOG_PROPERTY_ENTRIES);
result.putAll(Maps.uniqueIndex(propertyEntries, PropertyEntry::getName));
PROPERTIES_METADATA = ImmutableMap.copyOf(result);
}

@Override
Expand Down

0 comments on commit 87c6445

Please sign in to comment.