Skip to content

Commit

Permalink
Merge pull request #2470 from MicrosoftDocs/main638689321269941950syn…
Browse files Browse the repository at this point in the history
…c_temp

For protected branch, push strategy should use PR and merge to target branch method to work around git push error
  • Loading branch information
learn-build-service-prod[bot] authored Dec 4, 2024
2 parents a6ec9aa + 35ea235 commit fd9cab0
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 66 deletions.
63 changes: 33 additions & 30 deletions data-explorer/kusto/query/lookup-operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,26 @@ title: lookup operator
description: Learn how to use the lookup operator to extend columns of a fact table.
ms.reviewer: alexans
ms.topic: reference
ms.date: 08/11/2024
ms.date: 12/04/2024
---
# lookup operator

> [!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)]
Extends the columns of a fact table with values looked-up in a dimension table.

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).

```kusto
FactTable | lookup kind=leftouter (DimensionTable) on CommonColumn, $left.Col1 == $right.Col2
```

Here, the result is a table that extends the `FactTable` (`$left`) with data from `DimensionTable` (referenced by `$right`)
by performing a lookup of each pair (`CommonColumn`,`Col`) from the former table
with each pair (`CommonColumn1`,`Col2`) in the latter table.
For the differences between fact and dimension tables, see [fact and dimension tables](../concepts/fact-and-dimension-tables.md).

The `lookup` operator performs an operation similar to the [join operator](join-operator.md)
with the following differences:

* The result doesn't repeat columns from the `$right` table that are the basis
for the join operation.
* Only two kinds of lookup are supported, `leftouter` and `inner`,
with `leftouter` being the default.
* Only two kinds of lookup are supported, `leftouter` and `inner`, with `leftouter` being the default.
* In terms of performance, the system by default assumes that the `$left` table
is the larger (facts) table, and the `$right` table is the smaller (dimensions)
table. This is exactly opposite to the assumption used by the `join` operator.
Expand All @@ -45,7 +41,7 @@ with the following differences:
## Syntax
*LeftTable* `|` `lookup` [`kind` `=` (`leftouter`|`inner`)] `(`*RightTable*`)` `on` *Conditions*
*LeftTable* `|` `lookup` [`kind` `=` (`leftouter`|`inner`)] `(`*RightTable*`)` `on` *Attributes*
[!INCLUDE [syntax-conventions-note](../includes/syntax-conventions-note.md)]
Expand All @@ -56,7 +52,7 @@ with the following differences:
|*LeftTable*| `string` | :heavy_check_mark:|The table or tabular expression that is the basis for the lookup. Denoted as `$left`.|
|*RightTable*| `string` | :heavy_check_mark:|The table or tabular expression that is used to "populate" new columns in the fact table. Denoted as `$right`.|
|*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).|
|`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.|
|`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.|
### Rules
Expand All @@ -73,45 +69,52 @@ with the following differences:
A table with:
* A column for every column in each of the two tables, including the matching keys.
The columns of the right side will be automatically renamed if there are name conflicts.
The columns of the right side are automatically renamed if there are name conflicts.
* 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.
* The Attributes (lookup keys) will appear only once in the output table.
* The *Attributes* (lookup keys) appear only once in the output table.
* 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.
* If `kind=inner`, then there's a row in the output for every combination of matching rows from left and right.
## Examples
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.
:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
> <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>
> <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>
::: moniker-end
```kusto
let FactTable=datatable(Row:string,Personal:string,Family:string) [
"1", "Bill", "Gates",
"2", "Bill", "Clinton",
"3", "Bill", "Clinton",
"4", "Steve", "Ballmer",
"5", "Tim", "Cook"
"1", "Rowan", "Murphy",
"2", "Ellis", "Turner",
"3", "Ellis", "Turner",
"4", "Maya", "Robinson",
"5", "Quinn", "Campbell"
];
let DimTable=datatable(Personal:string,Family:string,Alias:string) [
"Bill", "Gates", "billg",
"Bill", "Clinton", "billc",
"Steve", "Ballmer", "steveb",
"Tim", "Cook", "timc"
"Rowan", "Murphy", "rowanm",
"Ellis", "Turner", "ellist",
"Maya", "Robinson", "mayar",
"Quinn", "Campbell", "quinnc"
];
FactTable
| lookup kind=leftouter DimTable on Personal, Family
```
Row | Personal | Family | Alias
--------|-----------|----------|--------
1 | Bill | Gates | billg
2 | Bill | Clinton | billc
3 | Bill | Clinton | billc
4 | Steve | Ballmer | steveb
5 | Tim | Cook | timc
**Output**

| Row | Personal | Family | Alias |
|--|--|--|--|
| 1 | Rowan | Murphy | rowanm |
| 2 | Ellis | Turner | ellist |
| 3 | Ellis | Turner | ellist |
| 4 | Maya | Robinson | mayar |
| 5 | Quinn | Campbell | quinnc |

## Related content

* [Broadcast join](broadcast-join.md).
* [Broadcast join](broadcast-join.md)
* [leftouter join](join-leftouter.md)
* [inner join](join-inner.md)
* [join operator](join-operator.md)
72 changes: 36 additions & 36 deletions data-explorer/web-ui-query-keyboard-shortcuts.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,56 @@ title: Azure Data Explorer web UI query keyboard shortcuts
description: This article describes Azure Data Explorer query keyboard shortcuts (hot keys) in Azure Data Explorer web UI.
ms.reviewer: mibar
ms.topic: reference
ms.date: 05/28/2023
ms.date: 12/04/2024
---

# Azure Data Explorer web UI keyboard shortcuts

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.

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>.
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>.

## Query editor

| To do this action | Press |
| --------------------------------------------- | ------------------------------------------------------------ |
| Show command palette | <kbd>F1</kbd> |
| Copy query link to clipboard | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>L</kbd> |
| Copy query and link to clipboard | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>C</kbd> |
| Copy line(s) up | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>UpArrow</kbd> |
| Copy line(s) down | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>DownArrow</kbd> |
| Toggle line(s) comment | <kbd>Ctrl</kbd>+<kbd>/</kbd> |
| Find | <kbd>Ctrl</kbd>+<kbd>F</kbd> |
| Fold | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>[</kbd> |
| Fold all | <kbd>Ctrl</kbd>+<kbd>K</kbd> <kbd>Ctrl</kbd>+<kbd>0</kbd> |
| Format selection | <kbd>Ctrl</kbd>+<kbd>K</kbd> <kbd>Ctrl</kbd>+<kbd>F</kbd> |
| Format all | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>F</kbd> |
| Go to line | <kbd>Ctrl</kbd>+<kbd>G</kbd> |
| Go to Next Problem (Error, Warning, Info) | <kbd>Alt</kbd>+<kbd>F8</kbd> |
| Go to Previous Problem (Error, Warning, Info) | <kbd>Shift</kbd>+<kbd>F8</kbd> |
| Insert line above | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Enter</kbd> |
| Insert Line Below | <kbd>Ctrl</kbd>+<kbd>Enter</kbd> |
| Move line down | <kbd>Alt</kbd>+<kbd>DownArrow</kbd> |
| Move line up | <kbd>Alt</kbd>+<kbd>UpArrow</kbd> |
| Add new tab | <kbd>Ctrl</kbd>+<kbd>J</kbd> |
| Show Editor Context Menu | <kbd>Shift</kbd>+<kbd>F10</kbd> |
| Switch to tab on the left | <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>[</kbd> |
| Switch to tab on the right | <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>]</kbd> |
| Unfold | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>]</kbd> |
| Unfold all | <kbd>Ctrl</kbd>+<kbd>K</kbd> <kbd>Ctrl</kbd>+<kbd>J</kbd> |
| Run query | <kbd>Shift</kbd>+<kbd>Enter</kbd> |
| Recall execution result | <kbd>F8</kbd> |
| Reopen closed tab | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>T</kbd> |
| To do this action | Windows shortcuts | Mac shortcuts |
|--|--|--|
| Show command palette | <kbd>F1</kbd> | <kbd>F1</kbd> |
| Copy query link to clipboard | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>L</kbd> | <kbd>Shift</kbd>+<kbd>Option</kbd>+<kbd>L</kbd> |
| Copy query and link to clipboard | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>C</kbd> | <kbd>Shift</kbd>+<kbd>Option</kbd>+<kbd>C</kbd> |
| Copy line(s) up | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>UpArrow</kbd> | <kbd>Shift</kbd>+<kbd>Option</kbd>+<kbd>UpArrow</kbd> |
| Copy line(s) down | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>DownArrow</kbd> | <kbd>Shift</kbd>+<kbd>Option</kbd>+<kbd>DownArrow</kbd> |
| Toggle line(s) comment | <kbd>Ctrl</kbd>+<kbd>/</kbd> | <kbd>&#x2318;</kbd>+<kbd>/</kbd> |
| Find | <kbd>Ctrl</kbd>+<kbd>F</kbd> | <kbd>&#x2318;</kbd>+<kbd>F</kbd> |
| Fold | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>[</kbd> | |
| 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> |
| 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> |
| Format all | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>F</kbd> | <kbd>Shift</kbd>+<kbd>Option</kbd>+<kbd>F</kbd> |
| Go to line | <kbd>Ctrl</kbd>+<kbd>G</kbd> | |
| Go to Next Problem (Error, Warning, Info) | <kbd>Alt</kbd>+<kbd>F8</kbd> | <kbd>Option</kbd>+<kbd>F8</kbd> |
| Go to Previous Problem (Error, Warning, Info) | <kbd>Shift</kbd>+<kbd>F8</kbd> | <kbd>Option</kbd>+<kbd>Shift</kbd>+<kbd>F8</kbd> |
| Insert line above | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Enter</kbd> | <kbd>&#x2318;</kbd>+<kbd>Shift</kbd>+<kbd>Enter</kbd> |
| Insert Line Below | <kbd>Ctrl</kbd>+<kbd>Enter</kbd> | <kbd>&#x2318;</kbd>+<kbd>Enter</kbd> |
| Move line down | <kbd>Alt</kbd>+<kbd>DownArrow</kbd> | <kbd>Option</kbd>+<kbd>DownArrow</kbd> |
| Move line up | <kbd>Alt</kbd>+<kbd>UpArrow</kbd> | <kbd>Option</kbd>+<kbd>UpArrow</kbd> |
| Add new tab | <kbd>Ctrl</kbd>+<kbd>J</kbd> | <kbd>&#x2318;</kbd>+<kbd>J</kbd> |
| Show Editor Context Menu | <kbd>Shift</kbd>+<kbd>F10</kbd> | <kbd>Shift</kbd>+<kbd>F10</kbd> |
| Switch to tab on the left | <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>[</kbd> | <kbd>&#x2318;</kbd>+<kbd>Option</kbd>+<kbd>[</kbd> |
| Switch to tab on the right | <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>]</kbd> | <kbd>&#x2318;</kbd>+<kbd>Option</kbd>+<kbd>]</kbd> |
| Unfold | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>]</kbd> | |
| 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> |
| Run query | <kbd>Shift</kbd>+<kbd>Enter</kbd> | <kbd>Shift</kbd>+<kbd>Enter</kbd> |
| Recall execution result | <kbd>F8</kbd> | <kbd>F8</kbd> |
| 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> |

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

## Results grid

| To do this action | Press |
| ----------------------------------------------------- | ------------------------------------------------- |
| Insert data cell selections as filters into the query | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Space</kbd> |
| [Column header] Toggle the sorting state | <kbd>Enter</kbd> |
| [Column header] Open the menu for the focused header | <kbd>Shift</kbd>+<kbd>Enter</kbd> |
| To do this action | Windows shortcuts | Mac shortcuts |
|--|--|--|
| 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> |
| [Column header] Toggle the sorting state | <kbd>Enter</kbd> | <kbd>Enter</kbd> |
| [Column header] Open the menu for the focused header | <kbd>Shift</kbd>+<kbd>Enter</kbd> | <kbd>Shift</kbd>+<kbd>Enter</kbd> |

## Related content

Expand Down

0 comments on commit fd9cab0

Please sign in to comment.