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

# Subscribe to GAQ

> Subscribes to GAQ and returns results in Apache Arrow format.

**Single location constraint:** Queries are scoped to a single location. Queries with multiple locations would produce multiple IAggregatesRetrievalResult instances, which would be translated into multiple ICellSet objects. This is currently not supported by the GAQ streaming service.




## OpenAPI

````yaml post /activeviam/pivot/rest/v10/cube/query/continuous-gaq/subscribe
openapi: 3.0.0
info:
  title: Atoti REST services
  version: 6.1.18-SNAPSHOT
servers:
  - description: Generated server url
    url: http://localhost:9090
security: []
tags:
  - description: Implementation of the REST API controller for an ActivePivot database.
    name: Database 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: API to access measures information.
    name: Diagnostics API
  - 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 (Experimental)
  - description: Endpoints for AI-based optimization of Atoti cubes
    name: AI Optimizer
  - 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 (Experimental)
  - description: Implementation of the REST Bulk API of the content server.
    name: Bulk REST API
paths:
  /activeviam/pivot/rest/v10/cube/query/continuous-gaq/subscribe:
    post:
      tags:
        - Continuous GAQ Query REST API (Experimental)
      summary: Subscribe to GAQ
      description: >
        Subscribes to GAQ and returns results in Apache Arrow format.


        **Single location constraint:** Queries are scoped to a single location.
        Queries with multiple locations would produce multiple
        IAggregatesRetrievalResult instances, which would be translated into
        multiple ICellSet objects. This is currently not supported by the GAQ
        streaming service.
      operationId: subscribeGaq
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GaqSubscribeInput'
        required: true
      responses:
        '200':
          content:
            application/vnd.apache.arrow.stream:
              schema:
                $ref: '#/components/schemas/ResponseBodyEmitter'
          description: GAQ subscribed successfully
components:
  schemas:
    GaqSubscribeInput:
      description: Subscription to Get Aggregates Query results for a specific publisher
      properties:
        gaqQueryRequest:
          $ref: '#/components/schemas/GaqQueryRequest'
          description: Query request
        publisherId:
          description: Publisher identifier
          type: string
      required:
        - gaqQueryRequest
        - publisherId
      type: object
    ResponseBodyEmitter:
      properties:
        timeout:
          format: int64
          type: integer
      type: object
    GaqQueryRequest:
      properties:
        branch:
          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
          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: object
            type: array
          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:
          description: The name of the cube to query.
          type: string
        filter:
          $ref: '#/components/schemas/Filter'
          description: Filter conditions to apply to the query.
        measures:
          description: The list of measures to include in the query.
          items:
            type: string
          type: array
        timeout:
          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
    Conditions:
      properties:
        values:
          additionalProperties:
            items:
              type: string
            type: array
            uniqueItems: true
          type: object
      type: object

````