You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Kusto查询中mv-expand后ingestion_time()值丢失的解决求助

解决方案

修改查询逻辑,在mv-expand操作前提前将ingestion_time()存储为临时列,后续基于该临时列生成partitiontime即可解决空值问题:

MyTable
        | where ingestion_time() >= ago(1d)
        | extend _temp_ingestion_time = ingestion_time()  // 提前保存原始行的摄入时间
        | mv-expand todynamic(SomeColumnContainingArrayStoredAsString)
        | project category='somecategory', body = pack_all(), _temp_ingestion_time
        | extend partitiontime = _temp_ingestion_time
        | project-away _temp_ingestion_time  // 可选:移除临时列,仅保留需要的三列
        | take 10     
原因说明

ingestion_time()是行级元数据函数,返回的是原始行的摄入时间。执行mv-expand时,原始行会被拆分为多行,此时后续调用ingestion_time()无法关联到原始行的元数据,因此返回空值。提前将元数据保存为普通列,就能在mv-expand拆分后的所有行中保留该值,最终可基于它生成目标partitiontime列。

内容的提问来源于stack exchange,提问作者Dhiraj

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.07 04:44:53