startQuery method

Future<StartQueryResponse> startQuery({
  1. required String queryStatement,
  2. required String workspaceName,
  3. String? clientToken,
})

Starts an asynchronous SQL query against workspace telemetry, annotations, data segment, and dataset data.

May throw AccessDeniedException. May throw ConflictingOperationException. May throw InternalFailureException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter queryStatement : The SQL query to execute against the workspace telemetry, annotations, data segment, and dataset data.

Parameter workspaceName : The name of the workspace to query.

Parameter clientToken : A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.

Implementation

Future<StartQueryResponse> startQuery({
  required String queryStatement,
  required String workspaceName,
  String? clientToken,
}) async {
  final $payload = <String, dynamic>{
    'queryStatement': queryStatement,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/workspaces/${Uri.encodeComponent(workspaceName)}/queries',
    hostPrefix: 'data.',
    exceptionFnMap: _exceptionFns,
  );
  return StartQueryResponse.fromJson(response);
}