【发布时间】:2021-09-11 20:40:38
【问题描述】:
问题描述:
当 source_table 接收到数据时,kusto 中的更新策略将运行以将数据存储在 end_point_table 中。 更新函数应处理重复数据并将新数据仅存储在 end_point_table 中。这意味着如果我们从 source_table 获得的数据与我们在 end_point_table 中的数据相同,则不会存储任何数据。
我做了什么:
end_point_table 已经有数据了
.ingest inline into table end_point_table <|
1,2020-01-01T12:00:00Z,property,128
我有一个名为 source_table 的源表,我将数据提取到其中,如下所示
.ingest inline into table source_table <|
1,2020-01-01T12:00:00Z,128
.ingest inline into table source_table <|
1,2020-01-01T12:00:00Z,property,128
下面的函数会自动触发
let _incoming =(
source_table
| where property == "property"
| project device_id, timestamp, value
| distinct *
);
let _old_data = (
end_point_table
);
_incoming
| join kind = leftouter(
_old_data
| summarize arg_max(timestamp, *) by device_id
) on device_id
| where (
timestamp != timestamp1
or value != value1
)
| project device_id, timestamp, value
结果: 当我在摄取后查询数据时,我得到了三行而不是像这样的一行
1,2020-01-01T12:00:00Z,property,128
1,2020-01-01T12:00:00Z,property,128
1,2020-01-01T12:00:00Z,property,128
问题是:
是否有任何解决方案可以避免摄取 end_point_table 中的重复数据。还是我错误地使用了更新策略
【问题讨论】: