execute_query
async
¶
execute_query(
graph_identifier: GraphIdentifier,
query_string: str,
language: QueryLanguage,
*,
config_overrides: Optional[AsyncNeptuneGraphClientConfig] = None,
parameters: Optional[DocumentValuedMap] = None,
plan_cache: Optional[PlanCacheType] = None,
explain_mode: Optional[ExplainMode] = None,
query_timeout_milliseconds: Optional[int] = None,
) -> AsyncGenerator[ExecuteQueryOutput]
Execute an openCypher query.
When invoking this operation in a Neptune Analytics cluster, the IAM user or role making the request must have a policy attached that allows one of the following IAM actions in that cluster, depending on the query:
-
neptune-graph:ReadDataViaQuery
-
neptune-graph:WriteDataViaQuery
-
neptune-graph:DeleteDataViaQuery
Parameters:
-
graph_identifier(GraphIdentifier) –The unique identifier of the Neptune Analytics graph.
-
query_string(str) –The query string to be executed.
-
language(QueryLanguage) –The query language the query is written in. Currently only openCypher is supported.
-
parameters(Optional[DocumentValuedMap], default:None) –The data parameters the query can use in JSON format. For example: {"name": "john", "age": 20}. (optional)
-
plan_cache(Optional[PlanCacheType], default:None) –Query plan cache is a feature that saves the query plan and reuses it on successive executions of the same query. This reduces query latency, and works for both
READandUPDATEqueries. The plan cache is an LRU cache with a 5 minute TTL and a capacity of 1000. -
explain_mode(Optional[ExplainMode], default:None) –The explain mode parameter returns a query explain instead of the actual query results. A query explain can be used to gather insights about the query execution such as planning decisions, time spent on each operator, solutions flowing etc.
-
query_timeout_milliseconds(Optional[int], default:None) –Specifies the query timeout duration, in milliseconds. (optional)
Raises:
-
AccessDeniedException–Raised in case of an authentication or authorization failure.
-
ConflictException–Raised when a conflict is encountered.
-
InternalServerException–A failure occurred on the server.
-
ThrottlingException–The exception was interrupted by throttling.
-
UnprocessableException–Request cannot be processed due to known reasons. Eg. partition full.
-
ValidationException–A resource could not be validated.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_neptune_graph/_services/async_neptune_graph.py
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 | |