View a markdown version of this page

Gremlin evaluationTimeoutBehavior 查詢提示 - Amazon Neptune

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

Gremlin evaluationTimeoutBehavior 查詢提示

根據預設,當 Gremlin 查詢超過查詢逾時時,Neptune 會取消查詢並傳回錯誤。evaluationTimeoutBehavior 查詢提示會變更此行為,讓 Neptune 串流回逾時發生之前計算的任何部分結果,而不是傳回錯誤。

注意

此查詢提示使用 with 步驟,而不是 withSideEffect,並且不使用 Neptune#字首。

語法

g.with('evaluationTimeoutBehavior', 'value').gremlin-traversal
可用值
  • partialResults – 當查詢逾時時,Neptune 會傳回逾時之前計算的任何結果。

  • exception – 當查詢逾時時,Neptune 會傳回錯誤。這是預設行為。

重要

此查詢提示只能與唯讀查詢搭配使用。如果您在變動查詢或啟用 DFE 的情況下使用此提示 (透過useDFE查詢提示或neptune_dfe_query_engine執行個體參數),Neptune 會傳回錯誤。

範例

如果超過查詢逾時,下列查詢會傳回部分結果:

g.with('evaluationTimeoutBehavior', 'partialResults').V().out().valueMap()