部分查询失败Partial query failures

“部分查询失败”是运行查询失败,只有在查询已经开始实际执行阶段之后才会被检测到。A partial query failure is a failure to run the query that gets detected only after the query has started the actual execution phase. 到那时,Kusto 已经将 HTTP 状态行 200 OK 返回给客户端,并且无法“收回”,因此必须在将查询结果返回给客户端的结果流中指示失败。By that time, Kusto has already returned the HTTP status line 200 OK back to the client, and cannot "take it back", so it has to indicate the failure in the result stream that carries the query results back to the client. (事实上,它可能已将一些结果数据返回给调用方。)(In fact, it may have already returned some result data back to the caller.)

存在几种类型的部分查询失败:There are several kinds of partial query failures:

  • 失控查询:占用过多资源的查询。Runaway queries: Queries that take up too many resources.
  • 结果截断:由于其结果集超出某种限制而被截断的查询。Result truncation: Queries whose result set has been truncated as it exceeded some limit.
  • 溢出:触发溢出错误的查询。Overflows: Queries that trigger an overflow error.

可通过以下两种方式之一将部分查询失败报告回客户端:Partial query failures can be reported back to the client in one of two ways:

  • 作为结果数据的一部分(一个特别类型的记录会指示这不是数据本身)。As part of the result data (a special kind of record indicates that this is not the data itself). 这是默认方式。This is the default way.
  • 作为结果流中“QueryStatus”表的一部分。As part of the "QueryStatus" table in the result stream. 这是通过使用请求的 properties 槽 (Kusto.Data.Common.ClientRequestProperties.OptionDeferPartialQueryFailures) 中的 deferpartialqueryfailures 选项完成的。This is done by using the deferpartialqueryfailures option in the request's properties slot (Kusto.Data.Common.ClientRequestProperties.OptionDeferPartialQueryFailures). 执行此操作的客户端负责使用服务的整个结果流查找 QueryStatus 结果,并确保该结果中没有任何记录的 Severity2 或更小。Clients that do that take on the responsibility to consume the entire result stream from the service, locate the QueryStatus result, and make sure no record in this result has a Severity of 2 or smaller.