Skip to content

Commit 35ea235

Browse files
authored
Merge pull request #6449 from MicrosoftDocs/main
12/4/2024 AM Publish
2 parents 6b73c57 + 0e4ae5d commit 35ea235

File tree

3 files changed

+70
-67
lines changed

3 files changed

+70
-67
lines changed

data-explorer/kusto/query/lookup-operator.md

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,26 @@ title: lookup operator
33
description: Learn how to use the lookup operator to extend columns of a fact table.
44
ms.reviewer: alexans
55
ms.topic: reference
6-
ms.date: 08/11/2024
6+
ms.date: 12/04/2024
77
---
88
# lookup operator
99

1010
> [!INCLUDE [applies](../includes/applies-to-version/applies.md)] [!INCLUDE [fabric](../includes/applies-to-version/fabric.md)] [!INCLUDE [azure-data-explorer](../includes/applies-to-version/azure-data-explorer.md)] [!INCLUDE [monitor](../includes/applies-to-version/monitor.md)] [!INCLUDE [sentinel](../includes/applies-to-version/sentinel.md)]
1111
1212
Extends the columns of a fact table with values looked-up in a dimension table.
1313

14+
For example, the following query results in a table that extends the `FactTable` (`$left`) with data from the `DimensionTable` (`$right`) by performing a lookup. The lookup matches each pair (`CommonColumn`, `Col1`) from `FactTable` with each pair (`CommonColumn`, `Col2`) in the `DimensionTable`. For the differences between fact and dimension tables, see [fact and dimension tables](../concepts/fact-and-dimension-tables.md).
15+
1416
```kusto
1517
FactTable | lookup kind=leftouter (DimensionTable) on CommonColumn, $left.Col1 == $right.Col2
1618
```
1719

18-
Here, the result is a table that extends the `FactTable` (`$left`) with data from `DimensionTable` (referenced by `$right`)
19-
by performing a lookup of each pair (`CommonColumn`,`Col`) from the former table
20-
with each pair (`CommonColumn1`,`Col2`) in the latter table.
21-
For the differences between fact and dimension tables, see [fact and dimension tables](../concepts/fact-and-dimension-tables.md).
22-
2320
The `lookup` operator performs an operation similar to the [join operator](join-operator.md)
2421
with the following differences:
2522

2623
* The result doesn't repeat columns from the `$right` table that are the basis
2724
for the join operation.
28-
* Only two kinds of lookup are supported, `leftouter` and `inner`,
29-
with `leftouter` being the default.
25+
* Only two kinds of lookup are supported, `leftouter` and `inner`, with `leftouter` being the default.
3026
* In terms of performance, the system by default assumes that the `$left` table
3127
is the larger (facts) table, and the `$right` table is the smaller (dimensions)
3228
table. This is exactly opposite to the assumption used by the `join` operator.
@@ -45,7 +41,7 @@ with the following differences:
4541
4642
## Syntax
4743
48-
*LeftTable* `|` `lookup` [`kind` `=` (`leftouter`|`inner`)] `(`*RightTable*`)` `on` *Conditions*
44+
*LeftTable* `|` `lookup` [`kind` `=` (`leftouter`|`inner`)] `(`*RightTable*`)` `on` *Attributes*
4945
5046
[!INCLUDE [syntax-conventions-note](../includes/syntax-conventions-note.md)]
5147
@@ -56,7 +52,7 @@ with the following differences:
5652
|*LeftTable*| `string` | :heavy_check_mark:|The table or tabular expression that is the basis for the lookup. Denoted as `$left`.|
5753
|*RightTable*| `string` | :heavy_check_mark:|The table or tabular expression that is used to "populate" new columns in the fact table. Denoted as `$right`.|
5854
|*Attributes*| `string` | :heavy_check_mark:|A comma-delimited list of one or more rules that describe how rows from *LeftTable* are matched to rows from *RightTable*. Multiple rules are evaluated using the `and` logical operator. See [Rules](#rules).|
59-
|`kind`| `string` ||Determines how to treat rows in *LeftTable* that have no match in *RightTable*. By default, `leftouter` is used, which means all those rows will appear in the output with null values used for the missing values of *RightTable* columns added by the operator. If `inner` is used, such rows are omitted from the output. Other kinds of join aren't supported by the `lookup` operator.|
55+
|`kind`| `string` ||Determines how to treat rows in *LeftTable* that have no match in *RightTable*. By default, `leftouter` is used, which means all those rows appear in the output with null values used for the missing values of *RightTable* columns added by the operator. If `inner` is used, such rows are omitted from the output. Other kinds of join aren't supported by the `lookup` operator.|
6056
6157
### Rules
6258
@@ -73,45 +69,52 @@ with the following differences:
7369
A table with:
7470
7571
* A column for every column in each of the two tables, including the matching keys.
76-
The columns of the right side will be automatically renamed if there are name conflicts.
72+
The columns of the right side are automatically renamed if there are name conflicts.
7773
* A row for every match between the input tables. A match is a row selected from one table that has the same value for all the `on` fields as a row in the other table.
78-
* The Attributes (lookup keys) will appear only once in the output table.
74+
* The *Attributes* (lookup keys) appear only once in the output table.
7975
* If `kind` is unspecified or `kind=leftouter`, then in addition to the inner matches, there's a row for every row on the left (and/or right), even if it has no match. In that case, the unmatched output cells contain nulls.
8076
* If `kind=inner`, then there's a row in the output for every combination of matching rows from left and right.
8177
8278
## Examples
8379
80+
The following example shows how to perform a left outer join between the `FactTable` and `DimTable`, based on matching values in the `Personal` and `Family` columns.
81+
8482
:::moniker range="azure-data-explorer"
8583
> [!div class="nextstepaction"]
86-
> <a href="https://dataexplorer.azure.com/clusters/help/databases/Samples?query=H4sIAAAAAAAAA32RsW4CMQyG93sKKxOVslDahYoBqOhatWwVQ+4wyMJJqotpVakP3wQ3h2BAGRL7k+X/UxgFVq6TtWsZZ1sn+eTX6C1+T5P0FPb2FfsUg+Nar5wn/vmv7uCjATBjY8EsiDnfuXxxgsnYQu4vyZIpSAzKJjfYQ2Hvgl9YoFk4Zo+9ssfC1uRPY3kuxoNpNk8NZ5ln8tcuNwXsnMmlS5saqXqUJW3u7XX9gIfAijvFNfQ5M5hUeq3yGlxzq4KQ704Kw180v8CZHz/hQGE7Y9xJPAr2gyDEANXMgjr9AbRCGP7OAQAA" target="_blank">Run the query</a>
84+
> <a href="https://dataexplorer.azure.com/clusters/help/databases/Samples?query=H4sIAAAAAAAAA32RPWsDMQxA94P7D8JTA176tSRkKG2zBdqSrXTQJU5rTravPptykB8fuedzQobgRdKzJT1MKsAKt2GDDanlDgMfjm4%2B3N%2B8D17bb%2FmmfO8s0pSv0GgacjaDz7oCELdCguBHaDngfB199zMI%2BQ%2FvEnwl0v0IN9Fb5TO8vwYfElzjgIlx%2F0Zb3iXDxwTfo7bjTBDPaLpGEYm6%2BlrUFbHbizaXald95BNp7C%2FkilfRStN8qpq8SxEo%2B4NQqRbyhSxx5gDCcG0yPXmcNEar30S22an8VV0dgJxrYwettrslqX1wMShflMFZmFwljJZHtRbAkO8BAAA%3D" target="_blank">Run the query</a>
8785
::: moniker-end
8886
8987
```kusto
9088
let FactTable=datatable(Row:string,Personal:string,Family:string) [
91-
"1", "Bill", "Gates",
92-
"2", "Bill", "Clinton",
93-
"3", "Bill", "Clinton",
94-
"4", "Steve", "Ballmer",
95-
"5", "Tim", "Cook"
89+
"1", "Rowan", "Murphy",
90+
"2", "Ellis", "Turner",
91+
"3", "Ellis", "Turner",
92+
"4", "Maya", "Robinson",
93+
"5", "Quinn", "Campbell"
9694
];
9795
let DimTable=datatable(Personal:string,Family:string,Alias:string) [
98-
"Bill", "Gates", "billg",
99-
"Bill", "Clinton", "billc",
100-
"Steve", "Ballmer", "steveb",
101-
"Tim", "Cook", "timc"
96+
"Rowan", "Murphy", "rowanm",
97+
"Ellis", "Turner", "ellist",
98+
"Maya", "Robinson", "mayar",
99+
"Quinn", "Campbell", "quinnc"
102100
];
103101
FactTable
104102
| lookup kind=leftouter DimTable on Personal, Family
105103
```
106104
107-
Row | Personal | Family | Alias
108-
--------|-----------|----------|--------
109-
1 | Bill | Gates | billg
110-
2 | Bill | Clinton | billc
111-
3 | Bill | Clinton | billc
112-
4 | Steve | Ballmer | steveb
113-
5 | Tim | Cook | timc
105+
**Output**
106+
107+
| Row | Personal | Family | Alias |
108+
|--|--|--|--|
109+
| 1 | Rowan | Murphy | rowanm |
110+
| 2 | Ellis | Turner | ellist |
111+
| 3 | Ellis | Turner | ellist |
112+
| 4 | Maya | Robinson | mayar |
113+
| 5 | Quinn | Campbell | quinnc |
114114

115115
## Related content
116116

117-
* [Broadcast join](broadcast-join.md).
117+
* [Broadcast join](broadcast-join.md)
118+
* [leftouter join](join-leftouter.md)
119+
* [inner join](join-inner.md)
120+
* [join operator](join-operator.md)

data-explorer/kusto/query/pattern-statement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ The application inspects the error, determines that the error indicates a missin
184184
```kusto
185185
declare pattern map_ip_to_longlat = (address:string)
186186
{
187-
("10.10.10.10") = { print Lat=37.405992, Long=-122.078515 }
187+
("10.10.10.10") = { print Lat=37.405992, Long=-122.078515 };
188188
};
189189
map_ip_to_longlat("10.10.10.10")
190190
```

data-explorer/web-ui-query-keyboard-shortcuts.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,56 +3,56 @@ title: Azure Data Explorer web UI query keyboard shortcuts
33
description: This article describes Azure Data Explorer query keyboard shortcuts (hot keys) in Azure Data Explorer web UI.
44
ms.reviewer: mibar
55
ms.topic: reference
6-
ms.date: 05/28/2023
6+
ms.date: 12/04/2024
77
---
88

99
# Azure Data Explorer web UI keyboard shortcuts
1010

1111
Keyboard shortcuts provide a quick way to navigate websites, and allow users to work more efficiently. Instead of using a pointing device, you use keys, or combinations of keys, to run tasks. This article lists Windows keyboard shortcuts that work in the Azure Data Explorer web UI query editor window and results grid.
1212

13-
The letters that appear below represent letter keys on your keyboard. For example, to use <kbd>G</kbd>+<kbd>N</kbd>, hold down the <kbd>G</kbd> key and then press <kbd>N</kbd>. If the command is <kbd>Ctrl</kbd>+<kbd>K</kbd> <kbd>Ctrl</kbd>+<kbd>X</kbd>, keep pressing <kbd>Ctrl</kbd>, and simultaneously press <kbd>K</kbd> and then <kbd>X</kbd>.
13+
The following letters represent letter keys on your keyboard. For example, to use <kbd>G</kbd>+<kbd>N</kbd>, hold down the <kbd>G</kbd> key and then press <kbd>N</kbd>. If the command is <kbd>Ctrl</kbd>+<kbd>K</kbd> <kbd>Ctrl</kbd>+<kbd>X</kbd>, keep pressing <kbd>Ctrl</kbd>, and simultaneously press <kbd>K</kbd> and then <kbd>X</kbd>.
1414

1515
## Query editor
1616

17-
| To do this action | Press |
18-
| --------------------------------------------- | ------------------------------------------------------------ |
19-
| Show command palette | <kbd>F1</kbd> |
20-
| Copy query link to clipboard | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>L</kbd> |
21-
| Copy query and link to clipboard | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>C</kbd> |
22-
| Copy line(s) up | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>UpArrow</kbd> |
23-
| Copy line(s) down | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>DownArrow</kbd> |
24-
| Toggle line(s) comment | <kbd>Ctrl</kbd>+<kbd>/</kbd> |
25-
| Find | <kbd>Ctrl</kbd>+<kbd>F</kbd> |
26-
| Fold | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>[</kbd> |
27-
| Fold all | <kbd>Ctrl</kbd>+<kbd>K</kbd> <kbd>Ctrl</kbd>+<kbd>0</kbd> |
28-
| Format selection | <kbd>Ctrl</kbd>+<kbd>K</kbd> <kbd>Ctrl</kbd>+<kbd>F</kbd> |
29-
| Format all | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>F</kbd> |
30-
| Go to line | <kbd>Ctrl</kbd>+<kbd>G</kbd> |
31-
| Go to Next Problem (Error, Warning, Info) | <kbd>Alt</kbd>+<kbd>F8</kbd> |
32-
| Go to Previous Problem (Error, Warning, Info) | <kbd>Shift</kbd>+<kbd>F8</kbd> |
33-
| Insert line above | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Enter</kbd> |
34-
| Insert Line Below | <kbd>Ctrl</kbd>+<kbd>Enter</kbd> |
35-
| Move line down | <kbd>Alt</kbd>+<kbd>DownArrow</kbd> |
36-
| Move line up | <kbd>Alt</kbd>+<kbd>UpArrow</kbd> |
37-
| Add new tab | <kbd>Ctrl</kbd>+<kbd>J</kbd> |
38-
| Show Editor Context Menu | <kbd>Shift</kbd>+<kbd>F10</kbd> |
39-
| Switch to tab on the left | <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>[</kbd> |
40-
| Switch to tab on the right | <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>]</kbd> |
41-
| Unfold | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>]</kbd> |
42-
| Unfold all | <kbd>Ctrl</kbd>+<kbd>K</kbd> <kbd>Ctrl</kbd>+<kbd>J</kbd> |
43-
| Run query | <kbd>Shift</kbd>+<kbd>Enter</kbd> |
44-
| Recall execution result | <kbd>F8</kbd> |
45-
| Reopen closed tab | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>T</kbd> |
17+
| To do this action | Windows shortcuts | Mac shortcuts |
18+
|--|--|--|
19+
| Show command palette | <kbd>F1</kbd> | <kbd>F1</kbd> |
20+
| Copy query link to clipboard | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>L</kbd> | <kbd>Shift</kbd>+<kbd>Option</kbd>+<kbd>L</kbd> |
21+
| Copy query and link to clipboard | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>C</kbd> | <kbd>Shift</kbd>+<kbd>Option</kbd>+<kbd>C</kbd> |
22+
| Copy line(s) up | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>UpArrow</kbd> | <kbd>Shift</kbd>+<kbd>Option</kbd>+<kbd>UpArrow</kbd> |
23+
| Copy line(s) down | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>DownArrow</kbd> | <kbd>Shift</kbd>+<kbd>Option</kbd>+<kbd>DownArrow</kbd> |
24+
| Toggle line(s) comment | <kbd>Ctrl</kbd>+<kbd>/</kbd> | <kbd>&#x2318;</kbd>+<kbd>/</kbd> |
25+
| Find | <kbd>Ctrl</kbd>+<kbd>F</kbd> | <kbd>&#x2318;</kbd>+<kbd>F</kbd> |
26+
| Fold | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>[</kbd> | |
27+
| Fold all | <kbd>Ctrl</kbd>+<kbd>K</kbd> <kbd>Ctrl</kbd>+<kbd>0</kbd> | <kbd>&#x2318;</kbd>+<kbd>K</kbd> <kbd>&#x2318;</kbd>+<kbd>0</kbd> |
28+
| Format selection | <kbd>Ctrl</kbd>+<kbd>K</kbd> <kbd>Ctrl</kbd>+<kbd>F</kbd> | <kbd>&#x2318;</kbd>+<kbd>K</kbd> <kbd>&#x2318;</kbd>+<kbd>F</kbd> |
29+
| Format all | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>F</kbd> | <kbd>Shift</kbd>+<kbd>Option</kbd>+<kbd>F</kbd> |
30+
| Go to line | <kbd>Ctrl</kbd>+<kbd>G</kbd> | |
31+
| Go to Next Problem (Error, Warning, Info) | <kbd>Alt</kbd>+<kbd>F8</kbd> | <kbd>Option</kbd>+<kbd>F8</kbd> |
32+
| Go to Previous Problem (Error, Warning, Info) | <kbd>Shift</kbd>+<kbd>F8</kbd> | <kbd>Option</kbd>+<kbd>Shift</kbd>+<kbd>F8</kbd> |
33+
| Insert line above | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Enter</kbd> | <kbd>&#x2318;</kbd>+<kbd>Shift</kbd>+<kbd>Enter</kbd> |
34+
| Insert Line Below | <kbd>Ctrl</kbd>+<kbd>Enter</kbd> | <kbd>&#x2318;</kbd>+<kbd>Enter</kbd> |
35+
| Move line down | <kbd>Alt</kbd>+<kbd>DownArrow</kbd> | <kbd>Option</kbd>+<kbd>DownArrow</kbd> |
36+
| Move line up | <kbd>Alt</kbd>+<kbd>UpArrow</kbd> | <kbd>Option</kbd>+<kbd>UpArrow</kbd> |
37+
| Add new tab | <kbd>Ctrl</kbd>+<kbd>J</kbd> | <kbd>&#x2318;</kbd>+<kbd>J</kbd> |
38+
| Show Editor Context Menu | <kbd>Shift</kbd>+<kbd>F10</kbd> | <kbd>Shift</kbd>+<kbd>F10</kbd> |
39+
| Switch to tab on the left | <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>[</kbd> | <kbd>&#x2318;</kbd>+<kbd>Option</kbd>+<kbd>[</kbd> |
40+
| Switch to tab on the right | <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>]</kbd> | <kbd>&#x2318;</kbd>+<kbd>Option</kbd>+<kbd>]</kbd> |
41+
| Unfold | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>]</kbd> | |
42+
| Unfold all | <kbd>Ctrl</kbd>+<kbd>K</kbd> <kbd>Ctrl</kbd>+<kbd>J</kbd> | <kbd>&#x2318;</kbd>+<kbd>K</kbd> <kbd>&#x2318;</kbd>+<kbd>J</kbd> |
43+
| Run query | <kbd>Shift</kbd>+<kbd>Enter</kbd> | <kbd>Shift</kbd>+<kbd>Enter</kbd> |
44+
| Recall execution result | <kbd>F8</kbd> | <kbd>F8</kbd> |
45+
| Reopen closed tab | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>T</kbd> | <kbd>&#x2318;</kbd>+<kbd>Shift</kbd>+<kbd>Option</kbd>+<kbd>T</kbd> |
4646

4747
<!-- | Go to definition | <kbd>Ctrl</kbd>+<kbd>F12</kbd> | // Line 32-->
4848

4949
## Results grid
5050

51-
| To do this action | Press |
52-
| ----------------------------------------------------- | ------------------------------------------------- |
53-
| Insert data cell selections as filters into the query | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Space</kbd> |
54-
| [Column header] Toggle the sorting state | <kbd>Enter</kbd> |
55-
| [Column header] Open the menu for the focused header | <kbd>Shift</kbd>+<kbd>Enter</kbd> |
51+
| To do this action | Windows shortcuts | Mac shortcuts |
52+
|--|--|--|
53+
| Insert data cell selections as filters into the query | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Space</kbd> | <kbd>&#x2318;</kbd>+<kbd>Shift</kbd>+<kbd>Space</kbd> |
54+
| [Column header] Toggle the sorting state | <kbd>Enter</kbd> | <kbd>Enter</kbd> |
55+
| [Column header] Open the menu for the focused header | <kbd>Shift</kbd>+<kbd>Enter</kbd> | <kbd>Shift</kbd>+<kbd>Enter</kbd> |
5656

5757
## Related content
5858

0 commit comments

Comments
 (0)