Skip to content

Commit

Permalink
[Kernel] Unify table feature logic into structred APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
vkorukanti committed Feb 13, 2025
1 parent e0e44b5 commit 7b96d0d
Show file tree
Hide file tree
Showing 16 changed files with 1,107 additions and 307 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,77 @@ public class TableConfig<T> {
// TableConfigs //
//////////////////

/**
* Whether this Delta table is append-only. Files can't be deleted, or values can't be updated.
*/
public static final TableConfig<Boolean> APPEND_ONLY =
new TableConfig<>(
"delta.appendOnly",
"false",
Boolean::valueOf,
value -> true,
"needs to be a boolean.",
true);

/**
* Enable change data feed output. When enabled, DELETE, UPDATE, and MERGE INTO operations will
* need to do additional work to output their change data in an efficiently readable format.
*/
public static final TableConfig<Boolean> CHANGE_DATA_FEED =
new TableConfig<>(
"delta.enableChangeDataFeed",
"false",
Boolean::valueOf,
value -> true,
"needs to be a boolean.",
true);

public static final TableConfig<String> CHECKPOINT_POLICY =
new TableConfig<>(
"delta.checkpointPolicy",
"classic",
v -> v,
value -> value.equals("classic") || value.equals("v2"),
"needs to be a string and one of 'classic' or 'v2'.",
true);

/** Whether commands modifying this Delta table are allowed to create new deletion vectors. */
public static final TableConfig<Boolean> ENABLE_DELETION_VECTORS_CREATION =
new TableConfig<>(
"delta.enableDeletionVectors",
"false",
Boolean::valueOf,
value -> true,
"needs to be a boolean.",
true);

/**
* Whether widening the type of an existing column or field is allowed, either manually using
* ALTER TABLE CHANGE COLUMN or automatically if automatic schema evolution is enabled.
*/
public static final TableConfig<Boolean> ENABLE_TYPE_WIDENING =
new TableConfig<>(
"delta.enableTypeWidening",
"false",
Boolean::valueOf,
value -> true,
"needs to be a boolean.",
true);

/**
* Indicates whether Row Tracking is enabled on the table. When this flag is turned on, all rows
* are guaranteed to have Row IDs and Row Commit Versions assigned to them, and writers are
* expected to preserve them by materializing them to hidden columns in the data files.
*/
public static final TableConfig<Boolean> ROW_TRACKING_ENABLED =
new TableConfig<>(
"delta.enableRowTracking",
"false",
Boolean::valueOf,
value -> true,
"needs to be a boolean.",
true);

/**
* The shortest duration we have to keep logically deleted data files around before deleting them
* physically.
Expand Down Expand Up @@ -175,6 +246,17 @@ public class TableConfig<T> {
Collections.unmodifiableMap(
new HashMap<String, TableConfig<?>>() {
{
addConfig(this, APPEND_ONLY);
addConfig(this, CHANGE_DATA_FEED);
addConfig(this, CHECKPOINT_POLICY);
addConfig(this, ENABLE_DELETION_VECTORS_CREATION);
addConfig(this, ENABLE_TYPE_WIDENING);
addConfig(this, ROW_TRACKING_ENABLED);
addConfig(this, LOG_RETENTION);
addConfig(this, EXPIRED_LOG_CLEANUP_ENABLED);
addConfig(this, TOMBSTONE_RETENTION);
addConfig(this, CHECKPOINT_INTERVAL);
addConfig(this, IN_COMMIT_TIMESTAMPS_ENABLED);
addConfig(this, TOMBSTONE_RETENTION);
addConfig(this, CHECKPOINT_INTERVAL);
addConfig(this, IN_COMMIT_TIMESTAMPS_ENABLED);
Expand Down

This file was deleted.

Loading

0 comments on commit 7b96d0d

Please sign in to comment.