Public API v2 → Append to External Table Endpoint
About the PUT /extraction/table endpoint
The PUT /extraction/table endpoint extracts data from a business view and adds the Parquet files to the path associated with an existing external table. This endpoint is available starting 2024.1.4.
Before using this endpoint, you must set the required configurations, such as enabling and configuring Advanced SQLi and setting the CMC configurations, and have an external table already created in the Spark Metastore. For more information, refer to References → Data Extraction via Advanced SQLi and Public API and Public API v2 → Extract to External Table.
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.
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
Examples:
https://mycluster.incorta.com/incorta/api/v2/default/extraction/table
https://10.1.2.3:8080/incorta/api/v2/default/extraction/table
Request URL Parameters
Parameter | Description | Type | Required |
---|---|---|---|
tenant | The tenant name (case-sensitive) | String | Required |
HTTP method
PUT
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.
Request body
{"sourceTableName": "string","targetTableName": "string","limit": "string"}
Request body parameters
Parameter | Type | Description | Required |
---|---|---|---|
sourceTableName | String | The fully qualified name of the verified business view in the following format: business_schema.business_view | Required |
targetTableName | String | The fully qualified name of the existing external table in the following format: external_schema.external_table . | Required |
limit | String/Integer | Specify if you want to extract all the view data, a specific number of records, or no data. Valid values are: ● "ALL" ● "NONE" ● An Integer value (For now, you cannot control the records to return. The endpoint automatically returns this first number of records.) | Required |
Request body example
{"sourceTableName": "SalesBsSchema.TransactionsView","targetTableName": "externalSchema1.Sales_externalTable1","limit": 20}
Endpoint response
The following table shows the HTTP response status codes for this endpoint.
Code | Description | Payload Response |
---|---|---|
200 | OK The endpoint successfully ran, extracted the view data, and added Parquet files to the path of the specified external table. | |
400 | Bad Request You provided invalid values. | {"errorMessages": [{"message": "string"}]} Example: {"Unrecognized token 'All': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false') at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 6, column: 16]"}]} |
401 | Unauthenticated 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]"} |
404 | Not Found The tenant doesn't exist or is disabled. | {"message": "string"} Example: {"message": "Invalid [DEFAULT] tenant in resource path"} |
500 | Internal Server Error The endpoint couldn’t run successfully due to a server error. | {"message": "string"} Example: {"message": "The target table name externalSchema1.Sales_externalTable not allowed for extraction"} |