Public API v2 → Delete External Table Endpoint

About the /extraction/table/{table} endpoint

The /extraction/table/{table} endpoint removes the definition of the specified external table from the Spark Metastore. This endpoint is available starting 2024.1.4.

Starting 2024.7.x and 2024.1.6, you can also instruct the endpoint to delete the related target path and Parquet files by setting the purge parameter to true.

Note

When disabling the purge parameter or when using a release before 2024.7.x or 2024.1.6, deleting external tables only removes their definition from the Spark Maetastore.

  • You must delete the respective Parquet files manually from the related target paths.
  • You must first remove all external tables in a schema before trying to delete it.

Only the Super admin user (and users with the SuperRole when the Super User Mode is enabled) can use this endpoint.

For information about how to get started with Public API v2, refer to References → Public API v2.

Note

Use the HTTPS or HTTP scheme according to your installation. You must use the HTTPS scheme to successfully run the API endpoints on Cloud installations.

Request URL

https://<cluster_URL>/incorta/api/v2/{tenant}/extraction/table/{table}?purge=false

Examples:

  • https://mycluster.incorta.com/incorta/api/v2/default/extraction/table/externalTable1?purge=false
  • https://10.1.2.3:8080/incorta/api/v2/default/extraction/table/externalTable1?purge=true

Request URL Parameters

ParameterDescriptionTypeRequired
tenantThe tenant name (case-sensitive)StringRequired
tableThe fully qualified name of the external table you want to delete in the following format: external_schema.external_table.StringRequired
purgeThis parameter is available starting 2024.7.x and 2024.1.6.
  ●  The default is false.
  ●  Set it to true to delete the target path and Parquet files related to the given external table, along with the table definition in the Spark Metastore.
StringRequired

HTTP method

DELETE

Request headers

{
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {access_token}"
}

You must use a valid access token for the Super admin user (or a user with the SuperRole if the Super User Mode is enabled). For information about creating an access token, refer to Public API v2 → Create an API access token.

Endpoint response

The following table shows the HTTP response status codes for this endpoint.

CodeDescriptionPayload Response
200OK
The endpoint successfully ran and deleted the external table and its related target path and files if purge is enabled.
400Bad Request
You provided invalid values.
{"message": "string"}
401Unauthenticated
The endpoint couldn’t run successfully due to authentication errors, such as an invalid or expired access token.
{"message": "string"}
Example:
{"message": "INC_09030108: Invalid authentication header. Invalid Token [abcd1234]"}
404Not Found
The tenant doesn't exist or is disabled.
{"message": "string"}
Example:
{"message": "Invalid [DEFAULT] tenant in resource path"}
500Internal Server Error
The endpoint couldn’t run successfully due to a server error.
{"message": "string"}
Example:
{"message": "The target table name should have schema specified"}