Edit

Query Execution - Execute Query

Executes a query against a dataflow and returns the result.
Executes a specified query against a dataflow and streams the result back to the caller. Supports using custom mashup documents for advanced scenarios.

This API supports long running operations (LRO).

Permissions

The caller must have execute permissions for the dataflow.

Required Delegated Scopes

Dataflow.Execute.All or Item.Execute.All.

Limitations

Queries can run for a maximum of 90 seconds.

Microsoft Entra supported identities

This API supports the Microsoft identities listed in this section.

Identity Support
User Yes
Service principal and Managed identities Yes

Response formats

Use the Accept header to negotiate the response media type. Today, the Apache Arrow streaming format is the only available response format; additional formats may be offered in the future.

Apache Arrow streaming format

Media type: application/vnd.apache.arrow.stream

When sending this media type, the pq-arrow-version media-type parameter is required and selects the Arrow encoding version:

  • pq-arrow-version=1 — Original Apache Arrow encoding. Compatible with all dataflows, including those that connect through an on-premises data gateway.
  • pq-arrow-version=2 — Newer Apache Arrow encoding with improved streaming performance. Not supported for dataflows that connect through an on-premises data gateway.

Example: Accept: application/vnd.apache.arrow.stream;pq-arrow-version=2

If the Accept header is omitted entirely (or */* is sent), the response defaults to application/vnd.apache.arrow.stream;pq-arrow-version=1.

Interface

POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/dataflows/{dataflowId}/executeQuery

URI Parameters

Name In Required Type Description
dataflowId
path True

string (uuid)

The Dataflow ID.

workspaceId
path True

string (uuid)

The workspace ID.

Request Header

Name Required Type Description
Accept

string

The desired media type of the response. See the operation description for the list of supported response formats. Today, only application/vnd.apache.arrow.stream is supported; when sending this media type, the pq-arrow-version parameter is required and must be either 1 or 2 (e.g. application/vnd.apache.arrow.stream;pq-arrow-version=1). If the header is omitted entirely, the default application/vnd.apache.arrow.stream;pq-arrow-version=1 is used.

Request Body

Name Required Type Description
queryName True

string

The name of the query to execute from the dataflow (or from the custom mashup document if provided).

customMashupDocument

string

Optional custom mashup document to override the dataflow's default mashup.

Responses

Name Type Description
200 OK

file

Query result was successfully streamed. The response body is encoded in the media type negotiated via the request's Accept header (see the operation description for the list of supported response formats).

When the response is in the Apache Arrow streaming format (application/vnd.apache.arrow.stream, the only format available today), results are streamed as Apache Arrow IPC; the Arrow encoding version returned matches the pq-arrow-version parameter sent on the request's Accept header (default 1). Refer to the Arrow documentation on how to read the stream in Python and other languages. Errors encountered during query execution or streaming are reported in an additional column at the end named 'PQ Arrow Metadata'.

202 Accepted

Request accepted, query execution in progress.

Headers

  • Location: string
  • x-ms-operation-id: string
  • Retry-After: integer
429 Too Many Requests

ErrorResponse

The service rate limit was exceeded. The server returns a Retry-After header indicating, in seconds, how long the client must wait before sending additional requests.

Headers

Retry-After: integer

Other Status Codes

ErrorResponse

Common error codes:

  • DataflowExecuteQueryError - Query execution failed. Some possible reasons include: the specified query name is invalid or empty, the custom mashup document is invalid, or the specified query name was not found in the dataflow (or in the custom mashup document if provided).

Definitions

Name Description
ErrorRelatedResource

The error related resource details object.

ErrorResponse

The error response.

ErrorResponseDetails

The error response details.

ExecuteQueryRequest

Request payload for executing a query against a dataflow.

ErrorRelatedResource

The error related resource details object.

Name Type Description
resourceId

string

The resource ID that's involved in the error.

resourceType

string

The type of the resource that's involved in the error.

ErrorResponse

The error response.

Name Type Description
errorCode

string

A specific identifier that provides information about an error condition, allowing for standardized communication between our service and its users.

isRetriable

boolean

When true, the request can be retried. Use the Retry-After response header to determine the delay, if available.

message

string

A human readable representation of the error.

moreDetails

ErrorResponseDetails[]

List of additional error details.

relatedResource

ErrorRelatedResource

The error related resource details.

requestId

string (uuid)

ID of the request associated with the error.

ErrorResponseDetails

The error response details.

Name Type Description
errorCode

string

A specific identifier that provides information about an error condition, allowing for standardized communication between our service and its users.

message

string

A human readable representation of the error.

relatedResource

ErrorRelatedResource

The error related resource details.

ExecuteQueryRequest

Request payload for executing a query against a dataflow.

Name Type Description
customMashupDocument

string

Optional custom mashup document to override the dataflow's default mashup.

queryName

string

The name of the query to execute from the dataflow (or from the custom mashup document if provided).