Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@
public class CatalogCommitterUtils {
private CatalogCommitterUtils() {}

/**
* Table property key to enable the catalogManaged table feature. This is a signal to Kernel to
* add this table feature to Kernel's protocol. This property won't be written to the delta
* metadata.
*/
public static final String CATALOG_MANAGED_ENABLEMENT_KEY =
TableFeatures.SET_TABLE_FEATURE_SUPPORTED_PREFIX
+ TableFeatures.CATALOG_MANAGED_R_W_FEATURE_PREVIEW.featureName();

/** Property key that specifies which version last updated the catalog entry. */
public static final String METASTORE_LAST_UPDATE_VERSION = "delta.lastUpdateVersion";

Expand Down Expand Up @@ -70,7 +61,7 @@ public static Map<String, String> extractProtocolProperties(Protocol protocol) {
if (protocol.supportsReaderFeatures() || protocol.supportsWriterFeatures()) {
for (String featureName : protocol.getReaderAndWriterFeatures()) {
properties.put(
TableFeatures.SET_TABLE_FEATURE_SUPPORTED_PREFIX + featureName,
TableFeatures.getTableFeature(featureName).getTableFeatureSupportKey(),
TableFeatures.SET_TABLE_FEATURE_SUPPORTED_VALUE);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,7 @@ protected TransactionImpl buildTransactionInternal(
Map<String, String> tablePropertiesWithDomainMetadataEnabled =
new HashMap<>(tableProperties.orElse(emptyMap()));
tablePropertiesWithDomainMetadataEnabled.put(
TableFeatures.SET_TABLE_FEATURE_SUPPORTED_PREFIX
+ TableFeatures.DOMAIN_METADATA_W_FEATURE.featureName(),
"supported");
TableFeatures.DOMAIN_METADATA_W_FEATURE.getTableFeatureSupportKey(), "supported");
tableProperties = Optional.of(tablePropertiesWithDomainMetadataEnabled);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,15 @@ public boolean hasKernelWriteSupport(Metadata metadata) {
return true;
}

/**
* Gets the key that turns on support for the respective table feature.
*
* @return the feature support key for the respective feature.
*/
public String getTableFeatureSupportKey() {
return TableFeatures.SET_TABLE_FEATURE_SUPPORTED_PREFIX + featureName();
}

/////////////////////////////////////////////////////////////////////////////////
/// Define the {@link TableFeature}s traits that define behavior/attributes. ///
/////////////////////////////////////////////////////////////////////////////////
Expand All @@ -175,7 +184,7 @@ public interface ReaderWriterFeatureType {}
public abstract static class LegacyWriterFeature extends TableFeature
implements LegacyFeatureType {
public LegacyWriterFeature(String featureName, int minWriterVersion) {
super(featureName, /* minReaderVersion = */ 0, minWriterVersion);
super(featureName, /* minReaderVersion= */ 0, minWriterVersion);
}

@Override
Expand All @@ -196,7 +205,7 @@ public LegacyReaderWriterFeature(
/** A base class for all non-legacy table writer features. */
public abstract static class WriterFeature extends TableFeature {
public WriterFeature(String featureName, int minWriterVersion) {
super(featureName, /* minReaderVersion = */ 0, minWriterVersion);
super(featureName, /* minReaderVersion= */ 0, minWriterVersion);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package io.delta.unity;

import static io.delta.kernel.commit.CatalogCommitterUtils.CATALOG_MANAGED_ENABLEMENT_KEY;
import static io.delta.kernel.internal.util.Preconditions.checkArgument;
import static io.delta.unity.utils.OperationTimer.timeUncheckedOperation;

Expand Down Expand Up @@ -226,7 +225,8 @@ private Map<String, String> getRequiredTablePropertiesForCreate(String ucTableId
final Map<String, String> requiredProperties = new HashMap<>();

requiredProperties.put(
CATALOG_MANAGED_ENABLEMENT_KEY, TableFeatures.SET_TABLE_FEATURE_SUPPORTED_VALUE);
TableFeatures.CATALOG_MANAGED_R_W_FEATURE_PREVIEW.getTableFeatureSupportKey(),
TableFeatures.SET_TABLE_FEATURE_SUPPORTED_VALUE);
requiredProperties.put(UC_TABLE_ID_KEY, ucTableId);

return requiredProperties;
Expand Down
Loading