处理期间引发 SSAS 表格模型超时

SSAS tabular model timeout raised during processing

在对 Azure 分析服务模型的表格模型执行完整处理时,我在处理 10 分钟后收到以下错误:

Failed to save modifications to the server. Error returned: 'Microsoft SQL: Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.. The exception was raised by the IDbCommand interface.

Technical Details:
RootActivityId: cd0cfc78-416a-4039-a79f-ed7fe9836906
Date (UTC): 2/27/2018 1:25:58 PM
The command has been canceled.. The exception was raised by the IDbCommand interface.
The command has been canceled.. The exception was raised by the IDbCommand interface.
The command has been canceled.. The exception was raised by the IDbCommand interface.
The command has been canceled.. The exception was raised by the IDbCommand interface.

模型的数据源是 Azure 数据仓库,SSAS 通过 SQL 身份验证对其进行身份验证。当超时发生时,一些分区已经检索了它们的所有行,但其他分区仍在处理。该模型包含 11 table 个,每个都有一个分区。

我在使用 Visual Studio 2015 和 SSMS 2017 进行处理时都遇到了错误。在 10 分钟(600 秒)超时后,我看不到任何 SSAS 服务器属性。单个 table 处理可以在没有超时问题的情况下完成,因为它们都在 10 分钟内完成。

我尝试在我的表格模型脚本语言 json 文件(即 Model.bim)的 dataSources.connectionDetails 对象中设置 timeout 属性。但是编辑它会删除身份验证凭据,然后重置凭据会删除 timeout 属性。所以我不知道 属性 是否与超时错误问题有关。

我正在使用的分区查询表达式示例:

let
    Source = #"SQL/resourcename database windows net;DatabaseName",
    MyQuery = 
    Value.NativeQuery(
        Source,
        "SELECT * FROM [dbo].[MyTable]"
    )
in
    MyQuery

感谢 GregGalloway 的提示,我发现可以使用 Power Query M 语言在每个分区的基础上设置超时。

所以我的 TMSL 对象的数据访问部分现在看起来像这样...

model.dataSource是这样的:

"dataSources": [
  {
    "type": "structured",
    "name": "MySource",
    "connectionDetails": {
      "protocol": "tds",
      "address": {
        "server": "serverName.database.windows.net",
        "database": "databaseName"
      },
      "authentication": null,
      "query": null
    },
    "options": {},
    "credential": {
      "AuthenticationKind": "UsernamePassword",
      "Username": "dbUsername",
      "EncryptConnection": true
    }
  }
]

各个分区查询也是如此(注意 CommandTimeout 参数):

let
    Source = Sql.Database("serverName.database.windows.net","databaseName",[CommandTimeout=#duration(0, 2, 0, 0)]),
    MyQuery = 
    Value.NativeQuery(
        Source,
        "SELECT * FROM [dbo].[MyTable]"
    )
in
    MyQuery

所以现在我为分区查询明确设置了 2 小时的超时。

数据源 -> 选项:增加命令超时(默认 600 秒)也可以解决问题: