GetWorkUnitResultsCommand

Returns the work units resulting from the query. Work units can be executed in any order and in parallel.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { LakeFormationClient, GetWorkUnitResultsCommand } from "@aws-sdk/client-lakeformation"; // ES Modules import
// const { LakeFormationClient, GetWorkUnitResultsCommand } = require("@aws-sdk/client-lakeformation"); // CommonJS import
const client = new LakeFormationClient(config);
const input = { // GetWorkUnitResultsRequest
  QueryId: "STRING_VALUE", // required
  WorkUnitId: Number("long"), // required
  WorkUnitToken: "STRING_VALUE", // required
};
const command = new GetWorkUnitResultsCommand(input);
const response = await client.send(command);
// consume or destroy the stream to free the socket.
const bytes = await response.ResultStream.transformToByteArray();
// const str = await response.ResultStream.transformToString();
// response.ResultStream.destroy(); // only applicable to Node.js Readable streams.

// { // GetWorkUnitResultsResponse
//   ResultStream: "<SdkStream>", // see \@smithy/types -> StreamingBlobPayloadOutputTypes
// };

GetWorkUnitResultsCommand Input

See GetWorkUnitResultsCommandInput for more details

Parameter
Type
Description
QueryId
Required
string | undefined

The ID of the plan query operation for which to get results.

WorkUnitId
Required
number | undefined

The work unit ID for which to get results. Value generated by enumerating WorkUnitIdMin to WorkUnitIdMax (inclusive) from the WorkUnitRange in the output of GetWorkUnits.

WorkUnitToken
Required
string | undefined

A work token used to query the execution service. Token output from GetWorkUnits.

GetWorkUnitResultsCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
ResultStream
StreamingBlobPayloadOutputTypes

Throws

Name
Fault
Details
AccessDeniedException
client

Access to a resource was denied.

ExpiredException
client

Contains details about an error where the query request expired.

InternalServiceException
server

An internal service error occurred.

InvalidInputException
client

The input provided was not valid.

ThrottledException
client

Contains details about an error where the query request was throttled.

LakeFormationServiceException
Base exception class for all service exceptions from LakeFormation service.