Delete a Layer

To delete a layer, use the deleteLayer method of AdminApi provided by the data-client module. You have to pass the catalog's HRN to which a layer belongs and the layer ID:

Scala
Java
val layerId = "layer-3"
adminApi.deleteLayer(catalogHrn, layerId).flatMap { _ =>
  log.info(s"deleted $layerId from $catalogHrn")
  Future.successful(catalogHrn)
}
String layerId = "layer-2";
CompletionStage<CompletionStage<HRN>> layerDeletionStage =
    adminApi
        .deleteLayer(catalogHrn, layerId)
        .thenApply(
            done -> {
              log.info("deleted `" + layerId + "` from catalog`" + catalogHrn + "`");
              CompletableFuture<HRN> retval = new CompletableFuture<HRN>();
              retval.complete(catalogHrn);
              return retval;
            });

Warning

Data loss
Once a layer is deleted, all the associated data and metadata is also deleted. There is no mechanism to undo the operation. Therefore, this should be done with caution.

You can delete volatile, stream and index layers.

Note

Deletion of Versioned Layers
You cannot delete versioned layers. If you try to delete a versioned layer, a DataClientException will be thrown.

results matching ""

    No results matching ""