Kusto - bin() 如何总结时间戳

Kusto - How does bin() summarize timestamp

正在学习 Kusto 但不了解 bin() 函数如何对时间戳进行分组:

StormEvents
| where StartTime > datetime(2007-02-14) and StartTime < datetime(2007-03-21)
| summarize event_count = count() by bin(StartTime, 7d)

结果是:

StartTime                           | event_count
**2007-02-12** 00:00:00.0000000     | 535
2007-02-19 00:00:00.0000000         | 1652
2007-02-26 00:00:00.0000000         | 1688
2007-03-05 00:00:00.0000000         | 442
2007-03-12 00:00:00.0000000         | 796
2007-03-19 00:00:00.0000000         | 54

问题:为什么结果的第一个日期从 2-12 开始,而不是我的代码指示的 2-14?

提前致谢

当您写 by bin(StartTime, 7d) 时,所有结果将被分装到 7 天的桶中,第一个桶从 01/01/0001(第一年的 1 月 1 日)开始。

如果你想控制bin()的起点,你可以使用bin_at()https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/binatfunction