> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Executes a GAQ and returns the result as an Arrow stream.

> Executes a GAQ on the specified cube and branch, with given measures, coordinates, filters, context, and timeout. The result is returned as an Apache Arrow stream.



## OpenAPI

````yaml engine/rest/6.2.2/openapi.json POST /activeviam/pivot/rest/v10/cube/query/gaq
openapi: 3.1.0
info:
  title: Atoti REST services
  version: 6.2.2-SNAPSHOT
servers:
  - description: The Atoti Server instance to query, over HTTPS
    url: https://{host}
    variables:
      host:
        default: my-atoti-server:9090
        description: Host and port of your Atoti Server instance
  - description: The Atoti Server instance to query, over plain HTTP
    url: http://{host}
    variables:
      host:
        default: my-atoti-server:9090
        description: Host and port of your Atoti Server instance
security: []
tags:
  - description: Implementation of the REST API controller for an ActivePivot database.
    name: Database REST API
  - description: >
      GetAggregatesQuery (GAQ) REST API for executing OLAP queries.


      This API provides a programmatic way to execute GetAggregatesQuery
      operations

      against Atoti cubes. Results are returned in Apache Arrow format for
      efficient

      data transfer and processing.


      **Note:** This API is experimental and may change in future versions
      without notice.
    name: GAQ Query REST API
  - description: >
      XML for Analysis (XMLA) endpoint for executing MDX queries and OLAP
      discovery operations.


      This endpoint implements the XMLA protocol which is used by:

      - Microsoft Excel and other OLAP clients

      - Custom BI tools that support XMLA connectivity


      The endpoint supports both text XML and binary XML formats for improved
      performance.
    name: XMLA API
  - description: Definition of REST API to query data from ActivePivot (V10).
    name: Query REST API (V10)
  - description: Definition of REST API to query data from ActivePivot (V9).
    name: Query REST API (V9)
  - description: Implementation of the REST Bulk API of the content server (version 8).
    name: Bulk REST API
  - description: Implementation of the REST API of the content server.
    name: Content Server REST API
  - description: Implementation of the REST API controller for an ActivePivot database.
    name: Database REST API v9
  - description: ' Definition of the REST service returning the list of services exposed by an application.'
    name: Version REST API
  - description: Rest Service providing the discovery information.
    name: Discovery REST API
  - description: >-
      Endpoints for Atoti Auto-Explain, which explains how a measure varies
      between two members by attributing the variation to the hierarchies that
      drive it.
    name: Auto-Explain
  - description: JSON Web Token (JWT) endpoint.
    name: JWT API
  - description: >
      Endpoints to retrieve and manage query history.


      **Note:** This API is experimental and may change in future versions
      without notice.
    name: Query History REST API (Experimental)
  - description: Description of REST API to configure an ActivePivot application.
    name: Configuration REST API
  - description: API to export the result of MDX queries
    name: Data Export
  - description: >
      GetAggregatesQuery (GAQ) REST API for executing OLAP queries.


      This API provides a programmatic way to execute GetAggregatesQuery
      operations

      against Atoti cubes. Results and updates are streamed in Apache Arrow
      format for efficient

      data transfer and processing.
    name: Continuous GAQ Query REST API
  - description: Endpoints of the Atoti BI adapter.
    name: BI Adapter REST API
  - description: Endpoints for AI-based optimization of Atoti cubes
    name: AI Optimizer
  - description: Implementation of the REST Bulk API of the content server.
    name: Bulk REST API
paths:
  /activeviam/pivot/rest/v10/cube/query/gaq:
    post:
      tags:
        - GAQ Query REST API
      summary: Executes a GAQ and returns the result as an Arrow stream.
      description: >-
        Executes a GAQ on the specified cube and branch, with given measures,
        coordinates, filters, context, and timeout. The result is returned as an
        Apache Arrow stream.
      operationId: gaqQuery
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GaqQueryRequest'
        required: true
      responses:
        '200':
          content:
            application/vnd.apache.arrow.stream:
              schema:
                additionalProperties:
                  default: ''
                default: ''
                type: string
          description: Successful execution of the GAQ.
components:
  schemas:
    GaqQueryRequest:
      properties:
        branch:
          default: ''
          description: >-
            The specific branch of the cube to query. By default, the branch set
            by activeviam.branch.master property.
          type: string
        context:
          additionalProperties:
            type: string
          default: ''
          description: >
            Additional context values to configure query execution. Supported
            context values include:

            - `queriesTimeLimit`: Query timeout in seconds (e.g., "30")

            - `queriesResultLimit`: Maximum number of cells to return (e.g.,
            "10000")


            Context values are applied during query execution and reset after
            the query completes.
          type: object
        coordinates:
          additionalProperties:
            items: {}
            type: array
          default: ''
          description: >
            The coordinates for the query, mapping level descriptions to level
            members.

            Use `null` or the wildcard string as the value to express a wildcard
            (all members) for a given level. The wildcard string defaults to
            `[*]` and can be configured via the `activepivot.location.wildcard`
            system property. For example: `{"Currency@Currency@Currency":
            ["[*]"]}`.
          type: object
        cubeName:
          default: ''
          description: The name of the cube to query.
          type: string
        filter:
          $ref: '#/components/schemas/Filter'
          default: ''
          description: Filter conditions to apply to the query.
        measures:
          default: ''
          deprecated: true
          description: The list of measures to include in the query.
          items:
            deprecated: true
            type: string
          type: array
        page:
          $ref: '#/components/schemas/Page'
          default: ''
          description: >-
            Pagination window over the rows. When set, the server keeps a
            materialized view of the result and streams only the rows in
            [offset, offset + limit) as a full window snapshot on every update.
        sort:
          default: ''
          description: >-
            Ordering applied to the streamed rows. Sorting is only available for
            continuous queries. A one-shot query rejects a non-empty value. Each
            entry references either a requested measure (by name) or an
            expressed level (by its description, the same string form used as a
            `coordinates` key) and a direction. Entries are applied in order:
            the first is the primary key, the next break ties. Null values
            always sort last, regardless of direction. The ordering applies to
            the initial result, full-refresh updates, and the added rows of
            delta updates; removed rows of a delta update are ordered by the
            level keys only, since they carry no measure value. When omitted or
            empty, rows are ordered by the query's coordinate levels in
            ascending order, following the order they appear in `coordinates`.
          items:
            $ref: '#/components/schemas/SortField'
          type: array
        timeout:
          default: ''
          description: The timeout for the query in seconds.
          format: int32
          type: integer
      required:
        - cubeName
        - measures
      type: object
    Filter:
      properties:
        isInConditions:
          $ref: '#/components/schemas/Conditions'
        notInConditions:
          $ref: '#/components/schemas/Conditions'
      type: object
    Page:
      properties:
        limit:
          default: ''
          description: Maximum number of rows to stream.
          format: int32
          type: integer
        offset:
          default: ''
          description: Index of the first streamed row, inclusive, zero-based.
          format: int32
          type: integer
      required:
        - limit
        - offset
      type: object
    SortField:
      properties:
        direction:
          default: ''
          description: The ordering direction. Defaults to ASC when omitted.
          enum:
            - ASC
            - DESC
          type: string
        field:
          default: ''
          description: >-
            A requested measure name or an expressed level description to order
            by.
          type: string
      required:
        - field
      type: object
    Conditions:
      properties:
        values:
          additionalProperties:
            items:
              type: string
            type: array
            uniqueItems: true
          type: object
      type: object

````