Kusto:执行 leftsemi 联接,包括来自右侧 table 的列

Kusto: Do a leftsemi join including columns from right table

我想从不同的查询中查找值。我偶然发现了两个可能有意义的关键字:joinlookupleftsemi join 看起来正是我需要的,但我无法访问右侧的列。 我尝试过的任何其他变体都在添加更多行。结果 table 的条目不应多于 FactTable,但在空值的情况下可以更少。

let FactTable=datatable(name:string,timeprofile:string) [
  "Paul", "10:30",
  "Eric", "8:30",
  "Eric", "9:30",
  "Petra", "9:49"
];
let DimTable=datatable(name:string,details:string) [
   "Paul", "+",
   "Eric", "-",
   "Eric", "-",
   "Eric", "-",
   "Lessly", "++",
   "Martha", "+",
   "Martha", "+",
   "Martha", "+"
];
FactTable
| join kind=leftsemi DimTable on name 

但是生成的 table 缺少 DimTable 中的 details 列。

  1. 性能方面建议 Join when left side is small and right side is large
  2. 切换表的顺序后,默认的连接类型 innerunique 会完全满足您的需要 - 内部连接从左侧删除重复项

DimTable
| join kind=innerunique FactTable on name 

或者干脆

DimTable
| join FactTable on name 
name details name1 timeprofile
Paul + Paul 10:30
Eric - Eric 8:30
Eric - Eric 9:30

Fiddle