azure-data-explorer - 库斯托 : Projecting all columns as string

标签 azure-data-explorer kql

如果我想在项目中将所有列转换为字符串,我该怎么办?

T
| project tostring(a), tostring(b), tostring(c), ...

唯一的办法是分别施放它们吗?

最佳答案

我不知道有什么好方法可以转换多列,我不认为单独的项目可以做到这一点,但你可以做这样的事情来将值移动到一个列,然后再回到他们自己的列类型转换那个单一的专栏。我觉得使用列表可能是一种更好的方法,但我想不出任何办法。

let Example = datatable(AnInteger: int, ATimestamp:datetime, AString:string)
[
1, datetime(1910-06-11), "test",
2, datetime(1910-06-12), "test2"
];
Example
| evaluate narrow()
| extend p = pack(Column, Value)
| summarize bag=make_bag(p) by Row
| project-away Row
| evaluate bag_unpack(bag)
| extend type1=gettype(ATimestamp),
         type2=gettype(AnInteger),
         type3=gettype(AString) // just to show the values really are strings. Delete for your case

enter image description here

关于azure-data-explorer - 库斯托 : Projecting all columns as string,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61666815/

相关文章:

azure - KQL 分组依据与拖放分组功能的结果相同

azure - 如果 kusto 中没有结果,则返回 null 而不是什么也不返回

azure - 将连续的非零行标记到不同的分区中,这次使用 kusto(Azure AppInsights 的查询语言)

azure - kusto 步骤 1 年制作系列

azure - 更改 Kusto 中使用 make-series 操作生成的日期时间格式

azure-data-explorer - 如何在KQL中实现每个时间桶的前N个?

azure - 如何在 Azure Monitor 工作簿中显示请求的折线图?

python - 如何将 parquet 文件上传到 Azure ADLS 2 Blob

azure-data-explorer - 库斯托 |用 where 子句总结 count() 多列

kql - KUSTO 查询语言 (KQL) - 无法解压字典