【发布时间】:2020-12-19 19:16:31
【问题描述】:
我正在尝试使用 ADF 从 Azure Devops 到 Azure Kusto 集群进行增量加载。由于 Kusto 没有更新或删除特定记录的选项,我已按照以下步骤实现增量数据加载。
- 数据将首次作为完整加载加载到主表(表 A)中。
- 我将从表 A 中获取最大修改日期,并使用以下过滤器仅将最新修改的数据加载到 Kusto 中的 TableStg。(>=(maxmodifieddate-1 天)
- 我将在 Kusto 中创建一个临时表 (TableTemp) 以将修改/新数据(来自 TableStg)和现有数据合并到单个表中,然后使用以下 KQL 将主表(表 A)替换为临时表。李>
.set-or-replace TableTemp with (distributed=true) <| set notruncation;let updated=TableStg|union TableA |summarize maxdate=max(ChangedDate) by WorkItemId;let mergeupdate=(TableStg|union TableTemp)|distinct *|join kind=inner updated on $left.WorkItemId==$right.WorkItemId|whereChangedDate==maxdate;mergeupdate| project-away WorkItemId1, maxdate
.drop table TableA ifexists ;
.rename tables TableA=TableTemp;
对于大量记录,此查询因以下内存错误而失败。
“错误”:{ "code": "LimitsExceeded", "message": "请求无效,无法执行。", "@type": "Kusto.DataNode.Exceptions.KustoQueryRunawayException", "@message": "HResult: 0x80DA0001, source: (部分查询失败: 内存不足情况 (E_LOW_MEMORY_CONDITION)。(消息: 'bad allocation', details: ''))"
是否有任何选项可以优化此查询并实现增量加载?
我们还有其他方法可以在 Azure Kusto 中实现增量负载吗?
【问题讨论】: