tencent cloud

Feedback

SubmitSqlTask

Last updated: 2024-06-21 15:12:05

1. API Description

Domain name for API request: wedata.tencentcloudapi.com.

Ad Hoc Analysis - Submit SQL Task

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: SubmitSqlTask.
Version Yes String Common Params. The value used for this API: 2021-08-20.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
DatabaseType Yes String Database Type
DatasourceId Yes Integer Data Source ID
GroupId Yes String Resource Group ID
ScriptId Yes String Script File ID
ProjectId Yes String Project ID
DatabaseName No String Database name
EngineId No String Execution Engine Instance ID
ScriptContent No String Script Content
ResourceQueue No String Resource Queue
DatasourceType No String Database Type
ComputeResource No String Compute Resource Name
RunParams No String Advanced Running Parameters
ConfParams No String Advanced Settings
ScriptEncryption No Boolean Whether the script content is Base64 encrypted

3. Output Parameters

Parameter Name Type Description
Record AdhocRecord Task Submission Record
Details Array of AdhocDetail Subtask Record List
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Request demo

Input Example

POST / HTTP/1.1
Host: wedata.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: SubmitSqlTask
<Common request parameters>

{
    "ProjectId": "148541391437111111111",
    "DatasourceType": "HIVE",
    "DatasourceId": 1111,
    "GroupId": "20240409111111111",
    "ResourceQueue": "default",
    "ComputeResource": "",
    "DatabaseName": "",
    "ConfParams": "{\"RunConfParams\":\"\",\"AdhocFileName\":\"sqldemo.sql\",\"ResourceConfParams\":{}}",
    "DatabaseType": "HIVE",
    "ScriptId": "c6bff4c1-3ff1-4765-82b6-1111111",
    "ScriptContent": "LS1T",
    "ScriptEncryption": true,
    "RunParams": ""
}

Output Example

{
    "Response": {
        "Details": [
            {
                "EndTime": null,
                "Id": 43248,
                "RecordId": 30388,
                "ScriptContent": "select 1",
                "StartTime": null,
                "Status": "WAITING"
            }
        ],
        "Record": {
            "CreateTime": "2024-04-15T15:36:34+08:00",
            "Id": 30388,
            "InstanceId": "6202404151536358025_2024-04-15T15:36:35+08:00",
            "ScriptContent": "\n\n\n\n\nselect 1\n",
            "Status": "WAITING"
        },
        "RequestId": "65e7142b-7d21-4df8-af43-b5705a6f8923"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
AuthFailure CAM Signature/Authentication Error.
AuthFailure.SignatureExpire Not logged in or login has expired.
AuthFailure.UnauthorizedOperation CAM not authorized, please contact the primary account to grant the QcloudWeDataFullAccess policy to this account.
DryRunOperation Dry Run Operation, indicating that the request would be successful, but the DryRun parameter was additionally passed.
FailedOperation Operation Failure.
InternalError An internal error occurs.
InternalError.InternalCallCloudApiError Failed to call TencentCloud API.
InvalidParameter Parameter error.
InvalidParameter.DataEngineInstanceNotExists Data Engine Instance does not exist.
InvalidParameter.WeDataRoleNotExists WeData_QCSRole does not exist, please authorize the service.
InvalidParameter.WorkspaceNotExist Workspace does not exist.
InvalidParameterValue Parameter value error.
LimitExceeded Quota limit exceeded.
MissingParameter Missing Parameter Error.
OperationDenied Operation Rejected.
RequestLimitExceeded The number of requests exceeded the frequency limit.
ResourceInUse Resource Occupied.
ResourceInsufficient Insufficient resources.
ResourceNotFound The resource does not exist.
ResourceUnavailable Resource Unavailable.
ResourcesSoldOut Resources sold out.
UnauthorizedOperation Unauthorized Operation.
UnknownParameter Unknown parameter error.
UnsupportedOperation Operation not supported.