在表格模型上对Azure Analysis Service模型执行完整流程时,我在处理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个表,每个表都有一个分区。
在使用Visual Studio 2015和SSMS 2017进行处理时,我都收到错误。我看不到任何超过10分钟(600秒)的SSAS服务器属性。单个表处理可以在没有超时问题的情况下完成,因为它们都可以在10分钟内完成。
我已经尝试在我的表格模型脚本语言json文件(即Model.bim)中的timeout
对象中设置dataSources.connectionDetails
属性。但是编辑它会丢弃身份验证凭据,然后重置凭据会丢弃timeout
属性。所以我不知道该属性是否与超时错误问题有关。
我正在使用的分区查询表达式的示例:
let
Source = #"SQL/resourcename database windows net;DatabaseName",
MyQuery =
Value.NativeQuery(
Source,
"SELECT * FROM [dbo].[MyTable]"
)
in
MyQuery
答案 0 :(得分:1)
感谢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小时的超时。