次の方法で共有


serialize operator

Applies to: ✅Microsoft FabricAzure Data ExplorerAzure MonitorMicrosoft Sentinel

入力行セットの順序を、ウィンドウ関数に対して安全に使用できるとしてマークします。

この演算子には宣言型の意味があります。 It marks the input row set as serialized (ordered), so that window functions can be applied to it.

Syntax

serialize [Name1=Expr1 [,Name2=Expr2]...]

Learn more about syntax conventions.

Parameters

Name タイプ Required Description
Name string 追加または更新する列の名前。 省略すると、出力列名が自動的に生成されます。
Expr string ✔️ 入力に対して実行する計算。

Examples

このセクションの例では、構文を使用して作業を開始する方法を示します。

The examples in this article use publicly available tables in the help cluster, such as the StormEvents table in the Samples database.

The examples in this article use publicly available tables, such as the Weather table in the Weather analytics sample gallery. ワークスペース内のテーブルと一致するように、クエリ例のテーブル名を変更する必要がある場合があります。

条件によって行のサブセットをシリアル化する

This query retrieves all log entries from the TraceLogs table that have a specific ClientRequestId and preserves the order of these entries during processing.

TraceLogs
| where ClientRequestId == "5a848f70-9996-eb17-15ed-21b8eb94bf0e"
| serialize

Output

この表には、上位 5 件のクエリ結果のみが表示されます。

Timestamp Node Component ClientRequestId Message
2014-03-08T12:24:55.5464757Z Engine000000000757 INGESTOR_GATEWAY 5a848f70-9996-eb17-15ed-21b8eb94bf0e $$IngestionCommand table=fogEvents format=json
2014-03-08T12:24:56.0929514Z Engine000000000757 DOWNLOADER 5a848f70-9996-eb17-15ed-21b8eb94bf0e ファイル パスのダウンロード: ""https://benchmarklogs3.blob.core.windows.net/benchmark/2014/IMAGINEFIRST0_1399_0.json.gz""
2014-03-08T12:25:40.3574831Z Engine000000000341 INGESTOR_EXECUTER 5a848f70-9996-eb17-15ed-21b8eb94bf0e IngestionCompletionEvent: 完了したインジェスト ファイル パス: ""https://benchmarklogs3.blob.core.windows.net/benchmark/2014/IMAGINEFIRST0_1399_0.json.gz""
2014-03-08T12:25:40.9039588Z Engine000000000341 DOWNLOADER 5a848f70-9996-eb17-15ed-21b8eb94bf0e ファイル パスのダウンロード: ""https://benchmarklogs3.blob.core.windows.net/benchmark/2014/IMAGINEFIRST0_1399_1.json.gz""
2014-03-08T12:26:25.1684905Z Engine000000000057 INGESTOR_EXECUTER 5a848f70-9996-eb17-15ed-21b8eb94bf0e IngestionCompletionEvent: 完了したインジェスト ファイル パス: ""https://benchmarklogs3.blob.core.windows.net/benchmark/2014/IMAGINEFIRST0_1399_1.json.gz""
... ... ... ... ...

シリアル化されたテーブルに行番号を追加する

To add a row number to the serialized table, use the row_number() function.

TraceLogs
| where ClientRequestId == "5a848f70-9996-eb17-15ed-21b8eb94bf0e"
| serialize rn = row_number()

Output

この表には、上位 5 件のクエリ結果のみが表示されます。

Timestamp rn Node Component ClientRequestId Message
2014-03-08T13:00:01.6638235Z 1 Engine000000000899 INGESTOR_EXECUTER 5a848f70-9996-eb17-15ed-21b8eb94bf0e IngestionCompletionEvent: 完了したインジェスト ファイル パス: ""https://benchmarklogs3.blob.core.windows.net/benchmark/2014/IMAGINEFIRST0_1399_46.json.gz""
2014-03-08T13:00:02.2102992Z 2 Engine000000000899 DOWNLOADER 5a848f70-9996-eb17-15ed-21b8eb94bf0e ファイル パスのダウンロード: ""https://benchmarklogs3.blob.core.windows.net/benchmark/2014/IMAGINEFIRST0_1399_47.json.gz""
2014-03-08T13:00:46.4748309Z 3 Engine000000000584 INGESTOR_EXECUTER 5a848f70-9996-eb17-15ed-21b8eb94bf0e IngestionCompletionEvent: 完了したインジェスト ファイル パス: ""https://benchmarklogs3.blob.core.windows.net/benchmark/2014/IMAGINEFIRST0_1399_47.json.gz""
2014-03-08T13:00:47.0213066Z 4 Engine000000000584 DOWNLOADER 5a848f70-9996-eb17-15ed-21b8eb94bf0e ファイル パスのダウンロード: ""https://benchmarklogs3.blob.core.windows.net/benchmark/2014/IMAGINEFIRST0_1399_48.json.gz""
2014-03-08T13:01:31.2858383Z 5 Engine000000000380 INGESTOR_EXECUTER 5a848f70-9996-eb17-15ed-21b8eb94bf0e IngestionCompletionEvent: 完了したインジェスト ファイル パス: ""https://benchmarklogs3.blob.core.windows.net/benchmark/2014/IMAGINEFIRST0_1399_48.json.gz""
... ... ... ... ...

演算子のシリアル化動作

次の演算子の出力行セットは、シリアル化としてマークされます。

次の演算子の出力行セットは、非初期化としてマークされます。

他のすべての演算子は、シリアル化プロパティを保持します。 入力行セットがシリアル化されている場合、出力行セットもシリアル化されます。