Skip to content

Commit

Permalink
DomainMetadata Action
Browse files Browse the repository at this point in the history
  • Loading branch information
jaceklaskowski committed Jun 2, 2024
1 parent ca67e41 commit 1e37b8a
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 10 deletions.
3 changes: 2 additions & 1 deletion docs/Action.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Wraps the action into a [SingleAction](SingleAction.md) for serialization
See:

* [AddCDCFile](AddCDCFile.md#wrap)
* [DomainMetadata](DomainMetadata.md#wrap)

Used when:

Expand All @@ -46,7 +47,7 @@ Used when:

* `CheckpointOnlyAction`
* [CommitInfo](CommitInfo.md)
* `DomainMetadata`
* [DomainMetadata](DomainMetadata.md)
* [FileAction](FileAction.md)
* [Metadata](Metadata.md)
* [Protocol](Protocol.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/CurrentTransactionInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* <span id="actions"> [Action](Action.md)s
* <span id="readSnapshot"> Read [Snapshot](Snapshot.md)
* <span id="commitInfo"> Optional [CommitInfo](CommitInfo.md)
* <span id="readRowIdHighWatermark"> Read RowId HighWatermark
* <span id="domainMetadata"> `DomainMetadata`s
* <span id="readRowIdHighWatermark"> Read RowId High Watermark
* <span id="domainMetadata"> [DomainMetadata](DomainMetadata.md)s

`CurrentTransactionInfo` is created when:

Expand Down
18 changes: 16 additions & 2 deletions docs/DomainMetadata.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# DomainMetadata

`DomainMetadata` is an [Action](Action.md) that...FIXME
`DomainMetadata` is an [Action](Action.md) that represents a [named domain](#domain) with some [configuration](#configuration) (a JSON-encoded metadata).

`DomainMetadata` is part of [CurrentTransactionInfo](CurrentTransactionInfo.md#domainMetadata).

## Creating Instance

Expand All @@ -12,4 +14,16 @@

`DomainMetadata` is created when:

* `JsonMetadataDomain` is requested to `toDomainMetadata`
* `JsonMetadataDomain` is requested to [toDomainMetadata](JsonMetadataDomain.md#toDomainMetadata)

## SingleAction Representation { #wrap }

??? note "Action"

```scala
wrap: SingleAction
```

`wrap` is part of the [Action](Action.md#wrap) abstraction.

`wrap` creates a [SingleAction](SingleAction.md) with the [domainMetadata](SingleAction.md#domainmetadata) being this `DomainMetadata`.
32 changes: 31 additions & 1 deletion docs/DomainMetadataUtils.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
# DomainMetadataUtils

`DomainMetadataUtils`...FIXME
## domainMetadataSupported { #domainMetadataSupported }

```scala
domainMetadataSupported(
protocol: Protocol): Boolean
```

`domainMetadataSupported` holds true for a delta table (by the given [Protocol](Protocol.md)) with [support](table-features/TableFeatureSupport.md#isFeatureSupported) for [DomainMetadataTableFeature](table-features/DomainMetadataTableFeature.md) table feature.

---

`domainMetadataSupported` is used when:

* `ConflictChecker` is requested to [checkIfDomainMetadataConflict](ConflictChecker.md#checkIfDomainMetadataConflict)
* `DomainMetadataUtils` is requested to [validateDomainMetadataSupportedAndNoDuplicate](#validateDomainMetadataSupportedAndNoDuplicate)

## validateDomainMetadataSupportedAndNoDuplicate { #validateDomainMetadataSupportedAndNoDuplicate }

```scala
validateDomainMetadataSupportedAndNoDuplicate(
actions: Seq[Action],
protocol: Protocol): Seq[DomainMetadata]
```

`validateDomainMetadataSupportedAndNoDuplicate`...FIXME

---

`validateDomainMetadataSupportedAndNoDuplicate` is used when:

* `OptimisticTransactionImpl` is requested to [commitImpl](OptimisticTransactionImpl.md#commitImpl)
17 changes: 17 additions & 0 deletions docs/JsonMetadataDomain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# JsonMetadataDomain

## toDomainMetadata { #toDomainMetadata }

```scala
toDomainMetadata[T: Manifest]: DomainMetadata
```

`toDomainMetadata` creates a [DomainMetadata](DomainMetadata.md) action for this [domainName](#domainName), a JSON representation of this object (of type [T](#T)) and the [removed](DomainMetadata.md#removed) flag disabled.

---

`toDomainMetadata` is used when:

* `ConflictChecker` is requested to [reassignOverlappingRowIds](ConflictChecker.md#reassignOverlappingRowIds)
* `RowId` is requested to [assignFreshRowIds](row-tracking/RowId.md#assignFreshRowIds)
* `ClusteredTableUtilsBase` is requested to [createDomainMetadata](liquid-clustering/ClusteredTableUtilsBase.md#createDomainMetadata) and [getClusteringDomainMetadataForAlterTableClusterBy](liquid-clustering/ClusteredTableUtilsBase.md#getClusteringDomainMetadataForAlterTableClusterBy)
2 changes: 1 addition & 1 deletion docs/liquid-clustering/ClusteredTableUtilsBase.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ createDomainMetadata(
clusteringColumns: Seq[ClusteringColumn]): DomainMetadata
```

`createDomainMetadata` [creates a ClusteringMetadataDomain](ClusteringMetadataDomain.md#fromClusteringColumns) from the given `ClusteringColumn`s and [converts it to a DomainMetadata](JsonMetadataDomain.md#toDomainMetadata).
`createDomainMetadata` [creates a ClusteringMetadataDomain](ClusteringMetadataDomain.md#fromClusteringColumns) from the given `ClusteringColumn`s and [converts it to a DomainMetadata](../JsonMetadataDomain.md#toDomainMetadata).

## getClusterBySpecOptional { #getClusterBySpecOptional }

Expand Down
3 changes: 0 additions & 3 deletions docs/liquid-clustering/JsonMetadataDomain.md

This file was deleted.

1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ nav:
- DeltaTableUtils: DeltaTableUtils.md
- DomainMetadataUtils: DomainMetadataUtils.md
- ImplicitMetadataOperation: ImplicitMetadataOperation.md
- JsonMetadataDomain: JsonMetadataDomain.md
- SchemaMergingUtils: SchemaMergingUtils.md
- SchemaUtils: SchemaUtils.md
- StateCache:
Expand Down

0 comments on commit 1e37b8a

Please sign in to comment.