Delen via


fork operator

Applies to: ✅Microsoft FabricAzure Data ExplorerAzure MonitorMicrosoft Sentinel

Hiermee worden meerdere consumentenoperators parallel uitgevoerd.

Syntax

T|fork [name=](subquery) [name=](subquery) ...

Learn more about syntax conventions.

Parameters

Name Type Required Description
subquery string ✔️ Een downstream-pijplijn van ondersteunde queryoperators.
name string Een tijdelijke naam voor de resultaattabel van de subquery.

Note

  • Avoid using fork with a single subquery.
  • De naam van het tabblad Resultaten is dezelfde naam als die is opgegeven met de parameter name of de operator as.

Ondersteunde queryoperators

Returns

Multiple result tables, one for each of the subquery arguments.

Tips

  • Gebruik materialize als vervanging voor join of union op vorkpoten. De invoerstroom wordt in de cache opgeslagen door te materialiseren en vervolgens kan de expressie in de cache worden gebruikt in join-/samenvoegingspoten.

  • Use batch with materialize of tabular expression statements instead of the fork operator.

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. Mogelijk moet u de tabelnaam in de voorbeeldquery wijzigen zodat deze overeenkomt met de tabel in uw werkruimte.

In het volgende voorbeeld worden twee tabellen met niet-benoemde kolommen geretourneerd.

StormEvents
| where State == "FLORIDA"
| fork
    ( where DeathsDirect + DeathsIndirect > 1)
    ( where InjuriesDirect + InjuriesIndirect > 1)

Output

In deze uitvoer ziet u de eerste paar rijen en kolommen van de resultaattabel.

StartTime EndTime EpisodeId EventId State EventType InjuriesDirect InjuriesIndirect
2007-02-02T03:17:00Z 2007-02-02T03:25:00Z 3464 18948 FLORIDA Tornado 10 0
2007-02-02T03:37:00Z 2007-02-02T03:55:00Z 3464 18950 FLORIDA Tornado 9 0
2007-03-13T08:20:00Z 2007-03-13T08:20:00Z 4094 22961 FLORIDA Dense Fog 3 0
2007-09-11T15:26:00Z 2007-09-11T15:26:00Z 9578 53798 FLORIDA Rip Current 0 0

Named subqueries

In de volgende voorbeelden heet de resultaattabel 'StormsWithDeaths' en 'StormsWithInjuries'.

StormEvents
| where State == "FLORIDA"
| fork
    (where DeathsDirect + DeathsIndirect > 1 | as StormsWithDeaths)
    (where InjuriesDirect + InjuriesIndirect > 1 | as StormsWithInjuries)
StormEvents
| where State == "FLORIDA"
| fork
    StormsWithDeaths = (where DeathsDirect + DeathsIndirect > 1)
    StormsWithInjuries = (where InjuriesDirect + InjuriesIndirect > 1)

Output

In deze uitvoer ziet u de eerste paar rijen en kolommen van de resultaattabel.

StartTime EndTime EpisodeId EventId State EventType InjuriesDirect InjuriesIndirect
2007-02-02T03:17:00Z 2007-02-02T03:25:00Z 3464 18948 FLORIDA Tornado 10 0
2007-02-02T03:37:00Z 2007-02-02T03:55:00Z 3464 18950 FLORIDA Tornado 9 0
2007-03-13T08:20:00Z 2007-03-13T08:20:00Z 4094 22961 FLORIDA Dense Fog 3 0
2007-09-11T15:26:00Z 2007-09-11T15:26:00Z 9578 53798 FLORIDA Rip Current 0 0