GetQueryStateCommand

Returns the state of a query previously submitted. Clients are expected to poll GetQueryState to monitor the current state of the planning before retrieving the work units. A query state is only visible to the principal that made the initial call to StartQueryPlanning.

Example Syntax

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

import { LakeFormationClient, GetQueryStateCommand } from "@aws-sdk/client-lakeformation"; // ES Modules import
// const { LakeFormationClient, GetQueryStateCommand } = require("@aws-sdk/client-lakeformation"); // CommonJS import
const client = new LakeFormationClient(config);
const input = { // GetQueryStateRequest
  QueryId: "STRING_VALUE", // required
};
const command = new GetQueryStateCommand(input);
const response = await client.send(command);
// { // GetQueryStateResponse
//   Error: "STRING_VALUE",
//   State: "PENDING" || "WORKUNITS_AVAILABLE" || "ERROR" || "FINISHED" || "EXPIRED", // required
// };

GetQueryStateCommand Input

See GetQueryStateCommandInput for more details

Parameter
Type
Description
QueryId
Required
string | undefined

The ID of the plan query operation.

GetQueryStateCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
State
Required
QueryStateString | undefined

The state of a query previously submitted. The possible states are:

  • PENDING: the query is pending.

  • WORKUNITS_AVAILABLE: some work units are ready for retrieval and execution.

  • FINISHED: the query planning finished successfully, and all work units are ready for retrieval and execution.

  • ERROR: an error occurred with the query, such as an invalid query ID or a backend error.

Error
string | undefined

An error message when the operation fails.

Throws

Name
Fault
Details
AccessDeniedException
client

Access to a resource was denied.

InternalServiceException
server

An internal service error occurred.

InvalidInputException
client

The input provided was not valid.

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