///<summary>/// Delete a table from an AWS Glue database.///</summary>///<param name="tableName">The table to delete.</param>///<returns>A Boolean value indicating the success of the action.</returns>publicasync Task<bool> DeleteTableAsync(string dbName, string tableName){var response = await _amazonGlue.DeleteTableAsync(new DeleteTableRequest { Name = tableName, DatabaseName = dbName });
return response.HttpStatusCode == HttpStatusCode.OK;
}
有关 API 的详细信息,请参阅 AWS SDK for .NET API 参考DeleteTable中的。
classGlueWrapper:"""Encapsulates AWS Glue actions."""def__init__(self, glue_client):"""
:param glue_client: A Boto3 Glue client.
"""
self.glue_client = glue_client
defdelete_table(self, db_name, table_name):"""
Deletes a table from a metadata database.
:param db_name: The name of the database that contains the table.
:param table_name: The name of the table to delete.
"""try:
self.glue_client.delete_table(DatabaseName=db_name, Name=table_name)
except ClientError as err:
logger.error(
"Couldn't delete table %s. Here's why: %s: %s",
table_name,
err.response["Error"]["Code"],
err.response["Error"]["Message"],
)
raise
有关 API 的详细信息,请参阅适用DeleteTable于 Python 的AWS SDK (Boto3) API 参考。
# The `GlueWrapper` class serves as a wrapper around the AWS Glue API, providing a simplified interface for common operations.# It encapsulates the functionality of the AWS SDK for Glue and provides methods for interacting with Glue crawlers, databases, tables, jobs, and S3 resources.# The class initializes with a Glue client and a logger, allowing it to make API calls and log any errors or informational messages.classGlueWrapperdefinitialize(glue_client, logger)@glue_client = glue_client
@logger = logger
end# Deletes a table with the specified name.## @param database_name [String] The name of the catalog database in which the table resides.# @param table_name [String] The name of the table to be deleted.# @return [void]defdelete_table(database_name, table_name)@glue_client.delete_table(database_name: database_name, name: table_name)
rescue Aws::Glue::Errors::ServiceError => e
@logger.error("Glue could not delete job: \n#{e.message}")
end
有关 API 的详细信息,请参阅 AWS SDK for Ruby API 参考DeleteTable中的。
///<summary>/// Delete a table from an AWS Glue database.///</summary>///<param name="tableName">The table to delete.</param>///<returns>A Boolean value indicating the success of the action.</returns>publicasync Task<bool> DeleteTableAsync(string dbName, string tableName){var response = await _amazonGlue.DeleteTableAsync(new DeleteTableRequest { Name = tableName, DatabaseName = dbName });
return response.HttpStatusCode == HttpStatusCode.OK;
}
有关 API 的详细信息,请参阅 AWS SDK for .NET API 参考DeleteTable中的。