-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#446] feat(iceberg): Support detailed iceberg catalog property metadata
- Loading branch information
yunqing-wei
committed
Oct 12, 2023
1 parent
4d9e7a9
commit 878f2e7
Showing
5 changed files
with
196 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...a/com/datastrato/graviton/catalog/lakehouse/iceberg/IcebergCatalogPropertiesMetadata.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright 2023 Datastrato. | ||
* This software is licensed under the Apache License version 2. | ||
*/ | ||
package com.datastrato.graviton.catalog.lakehouse.iceberg; | ||
|
||
import static com.datastrato.graviton.catalog.PropertyEntry.enumImmutablePropertyEntry; | ||
import static com.datastrato.graviton.catalog.PropertyEntry.stringReservedPropertyEntry; | ||
|
||
import com.datastrato.graviton.catalog.BasePropertiesMetadata; | ||
import com.datastrato.graviton.catalog.PropertyEntry; | ||
import com.google.common.collect.ImmutableList; | ||
import com.google.common.collect.Maps; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class IcebergCatalogPropertiesMetadata extends BasePropertiesMetadata { | ||
public static final String CATALOG_TYPE = "catalogType"; | ||
public static final String WAREHOUSE = "WAREHOUSE"; | ||
public static final String URI = "URI"; | ||
|
||
private static final Map<String, PropertyEntry<?>> propertiesMetadata; | ||
|
||
enum IcebergCatalogType { | ||
HIVE, | ||
JDBC, | ||
MEMORY | ||
} | ||
|
||
static { | ||
List<PropertyEntry<?>> propertyEntries = | ||
ImmutableList.of( | ||
enumImmutablePropertyEntry( | ||
CATALOG_TYPE, | ||
"Iceberg catalog type choose properties", | ||
true, | ||
IcebergCatalogType.class, | ||
null, | ||
false, | ||
false), | ||
stringReservedPropertyEntry(URI, "Iceberg catalog uri config", false), | ||
stringReservedPropertyEntry(WAREHOUSE, "Iceberg catalog warehouse config", false)); | ||
propertiesMetadata = Maps.uniqueIndex(propertyEntries, PropertyEntry::getName); | ||
} | ||
|
||
@Override | ||
protected Map<String, PropertyEntry<?>> specificPropertyEntries() { | ||
return propertiesMetadata; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters