tencent cloud

Feedback

DescribeTaskResult

Last updated: 2024-08-08 15:32:02

    1. API Description

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

    This API is used to query the result of a task.

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

    This action accepts http content encodings: gzip

    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: DescribeTaskResult.
    Version Yes String Common Params. The value used for this API: 2021-01-25.
    Region Yes String Common Params. For more information, please see the list of regions supported by the product.
    TaskId Yes String Unique task ID
    NextToken No String The pagination information returned by the last response. This parameter can be omitted for the first response, where the data will be returned from the beginning. The data with a volume set by the MaxResults field is returned each time.
    MaxResults No Integer Maximum number of returned rows. Value range: 0–1,000. Default value: 1,000.
    IsTransformDataType No Boolean Whether to convert the data type

    3. Output Parameters

    Parameter Name Type Description
    TaskInfo TaskResultInfo The queried task information. If the returned value is empty, the task with the entered task ID does not exist. The task result will be returned only if the task status is 2 (succeeded).
    Note: This field may return null, indicating that no valid values can be obtained.
    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 Querying Task Results

    This example shows you how to query task results and return 1000 rows of data each time.

    Input Example

    POST / HTTP/1.1
    Host: dlc.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeTaskResult
    <Common request parameters>
    
    {
        "TaskId": "9e20f9c021cb11ec835f5254006c64af",
        "NextToken": ""
    }
    

    Output Example

    {
        "Response": {
            "RequestId": "9328049f-30bc-4feb-aecf-e3b4ff2d1b00",
            "TaskInfo": {
                "TaskId": "9e20f9c021cb11ec835f5254006c64af",
                "DatasourceConnectionName": "CosDataCatalog",
                "DatabaseName": "auth_test",
                "SQL": "SELECT * FROM `auth_test`.`hive_test` LIMIT 10",
                "SQLType": "DQL",
                "State": 2,
                "DataAmount": 850363,
                "UsedTime": 1761,
                "TotalTime": 2000,
                "OutputPath": "cosn://dlc-nj-1258469122/test/DLCQueryResults/2021/09/30/9e20f9c021cb11ec835f5254006c64af/",
                "CreateTime": "1632991895728",
                "OutputMessage": "success",
                "RowAffectInfo": "59378 rows affected (1.761000 seconds)",
                "ResultSchema": [
                    {
                        "Name": "a",
                        "Type": "integer",
                        "Comment": "",
                        "Precision": 0,
                        "Scale": 0,
                        "Nullable": "NULLABLE"
                    },
                    {
                        "Name": "b",
                        "Type": "varchar",
                        "Comment": "",
                        "Precision": 0,
                        "Scale": 0,
                        "Nullable": "NULLABLE"
                    }
                ],
                "ResultSet": "[[\"3\",\"kk\"],[\"3\",\"kk\"],[\"9143\",\" \\\"28992\\\"\"],[\"19048\",\" \\\"11266\\\"\"],[\"16711\",\" \\\"17422\\\"\"],[\"3816\",\" \\\"18501\\\"\"],[\"16428\",\" \\\"13774\\\"\"],[\"30190\",\" \\\"5177\\\"\"],[\"24824\",\" \\\"19479\\\"\"],[\"9709\",\" \\\"5532\\\"\"]]",
                "NextToken": "",
                "Percentage": 100,
                "ProgressDetail": "[{\"jobId\":\"0\",\"stages\":[{\"stageId\":\"0\",\"schedule\":1},{\"stageId\":\"1\",\"schedule\":1},{\"stageId\":\"2\",\"schedule\":1},{\"stageId\":\"3\",\"schedule\":1}],\"jobState\":\"\"}]",
                "DisplayFormat": "table"
            }
        }
    }
    

    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
    FailedOperation The operation failed.
    FailedOperation.HttpClientDoRequestFailed The HTTP client request failed.
    InternalError An internal error occurred.
    InvalidParameter The parameter is incorrect.
    InvalidParameter.InvalidMaxResults Invalid maximum number of results.
    InvalidParameter.InvalidSQLTaskMaxResults The number of SQL task results obtained at a time must be greater than 0 and less than 1,000.
    InvalidParameter.InvalidTaskId The taskid is invalid.
    InvalidParameter.MaxResultOnlySupportHundred You are currently only allowed to view 100 results. If you need to make an adjustment, please contact us.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support