Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/src/main/java/org/apache/iceberg/CatalogProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,7 @@ private CatalogProperties() {

public static final String LOCK_TABLE = "lock.table";

public static final String CATALOG_CACHE_ENABLED = "cache-enabled";
public static final String CATALOG_CACHE_ENABLED_DEFAULT = "false";

}
2 changes: 1 addition & 1 deletion site/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Iceberg catalogs support using catalog properties to configure catalog behaviors
| warehouse | null | the root path of the data warehouse |
| uri | null | a URI string, such as Hive metastore URI |
| clients | 2 | client pool size |

| cache-enabled | false | cache catalog, only works for Spark |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also a cache-enabled option in FlinkCatalogFactory. I have created a PR about this: #2648

`HadoopCatalog` and `HiveCatalog` can access the properties in their constructors.
Any other custom catalog can access the properties by implementing `Catalog.initialize(catalogName, catalogProperties)`.
The properties can be manually constructed or passed in from a compute engine like Spark or Flink.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.TreeMap;
import org.apache.hadoop.conf.Configuration;
import org.apache.iceberg.CachingCatalog;
import org.apache.iceberg.CatalogProperties;
import org.apache.iceberg.CatalogUtil;
import org.apache.iceberg.Schema;
import org.apache.iceberg.Table;
Expand Down Expand Up @@ -379,7 +380,8 @@ public boolean dropNamespace(String[] namespace) throws NoSuchNamespaceException

@Override
public final void initialize(String name, CaseInsensitiveStringMap options) {
this.cacheEnabled = Boolean.parseBoolean(options.getOrDefault("cache-enabled", "true"));
this.cacheEnabled = Boolean.parseBoolean(options.getOrDefault(CatalogProperties.CATALOG_CACHE_ENABLED,
CatalogProperties.CATALOG_CACHE_ENABLED_DEFAULT));
Catalog catalog = buildIcebergCatalog(name, options);

this.catalogName = name;
Expand Down