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

如何基于同名但不同数据类型的列连接两个Kusto表?

解决Kusto不同数据类型列的表连接问题

核心思路是将int64类型的列转换为string类型进行匹配,避免string转int时因数值溢出导致的数值改变问题(Kusto中int是32位整数,若string中的电话号码超过其范围,转换会丢失精度)。

修改后的查询语句

将table_2的phone_number(int64类型)通过tostring()函数转为string类型后再连接:

table_1
| project name, phone_number
| join kind=fullouter (
    table_2
    | project name, phone_number = tostring(phone_number)
) on $left.name == $right.name and $left.phone_number == $right.phone_number

额外处理场景(可选)

如果table_1的string类型phone_number包含非数字字符(如(123) 456-7890这类格式),需要先清洗字符串,移除非数字字符后再匹配:

table_1
| project name, phone_number = replace_all(phone_number, @'[^\d]', '') // 移除所有非数字字符
| join kind=fullouter (
    table_2
    | project name, phone_number = tostring(phone_number)
) on $left.name == $right.name and $left.phone_number == $right.phone_number

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.03 08:40:28