DeleteTableCommand

Removes a table definition from the Data Catalog.

After completing this operation, you no longer have access to the table versions and partitions that belong to the deleted table. Glue deletes these "orphaned" resources asynchronously in a timely manner, at the discretion of the service.

To ensure the immediate deletion of all related resources, before calling DeleteTable, use DeleteTableVersion or BatchDeleteTableVersion, and DeletePartition or BatchDeletePartition, to delete any resources that belong to the table.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { GlueClient, DeleteTableCommand } from "@aws-sdk/client-glue"; // ES Modules import
// const { GlueClient, DeleteTableCommand } = require("@aws-sdk/client-glue"); // CommonJS import
const client = new GlueClient(config);
const input = { // DeleteTableRequest
  CatalogId: "STRING_VALUE",
  DatabaseName: "STRING_VALUE", // required
  Name: "STRING_VALUE", // required
  TransactionId: "STRING_VALUE",
};
const command = new DeleteTableCommand(input);
const response = await client.send(command);
// {};

DeleteTableCommand Input

See DeleteTableCommandInput for more details

Parameter
Type
Description
DatabaseName
Required
string | undefined

The name of the catalog database in which the table resides. For Hive compatibility, this name is entirely lowercase.

Name
Required
string | undefined

The name of the table to be deleted. For Hive compatibility, this name is entirely lowercase.

CatalogId
string | undefined

The ID of the Data Catalog where the table resides. If none is provided, the Amazon Web Services account ID is used by default.

TransactionId
string | undefined

The transaction ID at which to delete the table contents.

DeleteTableCommand Output

See DeleteTableCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
ConcurrentModificationException
client

Two processes are trying to modify a resource simultaneously.

EntityNotFoundException
client

A specified entity does not exist

FederationSourceException
client

A federation source failed.

FederationSourceRetryableException
client

A federation source failed, but the operation may be retried.

InternalServiceException
server

An internal service error occurred.

InvalidInputException
client

The input provided was not valid.

OperationTimeoutException
client

The operation timed out.

ResourceNotReadyException
client

A resource was not ready for a transaction.

GlueServiceException
Base exception class for all service exceptions from Glue service.