Skip to content

Commit

Permalink
RemoveColumnMappingCommand et al.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaceklaskowski committed May 23, 2024
1 parent 4980784 commit 95a98b0
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/DeltaFileOperations.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: DeltaFileOperations
---

# DeltaFileOperations Utilities

## <span id="listUsingLogStore"> listUsingLogStore
Expand Down
4 changes: 4 additions & 0 deletions docs/DeltaTableOperations.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: DeltaTableOperations
---

# DeltaTableOperations &mdash; Delta DML Operations

`DeltaTableOperations` is an abstraction of [management services](#implementations) for [DeltaTable commands](#delta-commands).
Expand Down
4 changes: 4 additions & 0 deletions docs/SchemaUtils.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: SchemaUtils
---

# SchemaUtils Utility

## <span id="mergeSchemas"> mergeSchemas
Expand Down
50 changes: 50 additions & 0 deletions docs/commands/alter/RemoveColumnMappingCommand.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# RemoveColumnMappingCommand

`RemoveColumnMappingCommand` is a [ImplicitMetadataOperation](../../ImplicitMetadataOperation.md) to remove [column mapping](../../column-mapping/index.md) from a [delta table](#deltaLog).

`RemoveColumnMappingCommand` is used for [AlterTableSetPropertiesDeltaCommand](AlterTableSetPropertiesDeltaCommand.md) and [AlterTableUnsetPropertiesDeltaCommand](AlterTableUnsetPropertiesDeltaCommand.md) commands to exit early when executed with just the [delta.columnMapping.mode](../../table-properties/DeltaConfigs.md#COLUMN_MAPPING_MODE) table property being changed to `none` (and [spark.databricks.delta.columnMapping.allowRemoval](../../configuration-properties/index.md#columnMapping.allowRemoval) enabled).

`RemoveColumnMappingCommand` is a transactional command (that [starts a new transaction](../../DeltaLog.md#withNewTransaction) on the [delta table](#deltaLog) when [executed](#run)).

## Creating Instance

`RemoveColumnMappingCommand` takes the following to be created:

* <span id="deltaLog"> [DeltaLog](../../DeltaLog.md)
* <span id="catalogOpt"> `CatalogTable` ([Spark SQL]({{ book.spark_sql }}/CatalogTable))

`RemoveColumnMappingCommand` is created using [apply](#apply) utility.

## Creating RemoveColumnMappingCommand { #apply }

```scala
apply(
deltaLog: DeltaLog,
catalogOpt: Option[CatalogTable]): RemoveColumnMappingCommand
```

`apply` creates a [RemoveColumnMappingCommand](#creating-instance) for the given [DeltaLog](../../DeltaLog.md) and `CatalogTable`.

---

`apply` is used when:

* [AlterTableSetPropertiesDeltaCommand](AlterTableSetPropertiesDeltaCommand.md) is executed
* [AlterTableUnsetPropertiesDeltaCommand](AlterTableUnsetPropertiesDeltaCommand.md) is executed

## Executing Command { #run }

```scala
run(
spark: SparkSession,
removeColumnMappingTableProperty: Boolean): Unit
```

`run`...FIXME

---

`run` is used when:

* [AlterTableSetPropertiesDeltaCommand](AlterTableSetPropertiesDeltaCommand.md) is executed
* [AlterTableUnsetPropertiesDeltaCommand](AlterTableUnsetPropertiesDeltaCommand.md) is executed
4 changes: 3 additions & 1 deletion docs/commands/optimize/OptimizeTableCommand.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

`OptimizeTableCommand` uses [OptimizeExecutor](OptimizeExecutor.md) to [optimize](OptimizeExecutor.md#optimize) (when [executed](#run)).

`OptimizeTableCommand` is a `RunnableCommand` ([Spark SQL]({{ book.spark_sql }}/logical-operators/RunnableCommand)).
`OptimizeTableCommand` is a transactional command (and [starts a transaction](../../DeltaTableV2.md#startTransaction) at the [beginning of execution](#run)).

`OptimizeTableCommand` is a `UnaryNode` ([Spark SQL]({{ book.spark_sql }}/logical-operators/LogicalPlan#UnaryNode)).

## Creating Instance

Expand Down
20 changes: 20 additions & 0 deletions docs/row-tracking/RowTracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,23 @@ isEnabled(

!!! danger "Not Used"
`isEnabled` does not seem to be used.

## addPreservedRowTrackingTagIfNotSet { #addPreservedRowTrackingTagIfNotSet }

```scala
addPreservedRowTrackingTagIfNotSet(
snapshot: SnapshotDescriptor,
tagsMap: Map[String, String] = Map.empty): Map[String, String]
```

`addPreservedRowTrackingTagIfNotSet`...FIXME

---

`addPreservedRowTrackingTagIfNotSet` is used when:

* [DeleteCommand](../commands/delete/DeleteCommand.md) is executed
* [MergeIntoCommand](../commands/merge/MergeIntoCommand.md) is [executed](../commands/merge/MergeIntoCommand.md#runMerge)
* `OptimizeExecutor` is requested to [commitAndRetry](../commands/optimize/OptimizeExecutor.md#commitAndRetry)
* `UpdateCommand` is requested to [performUpdate](../commands/update/UpdateCommand.md#performUpdate)
* `RemoveColumnMappingCommand` is requested to [executed](../commands/alter/RemoveColumnMappingCommand.md#run)
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ nav:
- AlterTableSetLocationDeltaCommand: commands/alter/AlterTableSetLocationDeltaCommand.md
- SET TBLPROPERTIES: commands/alter/AlterTableSetPropertiesDeltaCommand.md
- AlterTableUnsetPropertiesDeltaCommand: commands/alter/AlterTableUnsetPropertiesDeltaCommand.md
- RemoveColumnMappingCommand: commands/alter/RemoveColumnMappingCommand.md
- Clone:
- ... | flat | commands/clone/**.md
- Convert:
Expand Down

0 comments on commit 95a98b0

Please sign in to comment.