AdvancedInfor Data Lake (Data Fabric)Compass API / Data Fabric

Infor Data Lake Compass API: Submit a Query, Poll and Fetch Results

Question
Infor Data Lake Compass API run query and fetch results

Also searched as

  • Infor Compass REST API submit query job
  • Data Fabric compass jobs queryId status result
  • run Compass SQL from Python Infor Data Lake
  • Infor Compass API pagination results offset

Short answer

The Compass API in Infor Data Fabric runs SQL against Data Lake objects asynchronously. You POST the SQL to start a job, poll the job until it reports finished, and then request the results in pages. Authentication is the same ION API token you use for other Infor OS services.

Applies to: Infor OS Data Fabric with Data Lake and Compass; endpoint paths and limits can differ by release, so confirm against the ION API documentation for your tenant

Run a Compass query from a script

  1. 1Create a backend service Authorized App and a service account with access to Data Lake, then download the .ionapi file.
  2. 2Request an OAuth token from the token endpoint in the file using the password grant.
  3. 3POST the SQL text as the body to the Compass jobs resource under the Data Fabric path of your tenant. The response returns a query id and a status.
  4. 4Poll the job by its query id every few seconds. Stop on a finished status, and treat failed or cancelled statuses as errors that carry a message.
  5. 5When finished, GET the result resource for that query id with an offset and a limit, and repeat until you have all rows or the reported row count.
  6. 6Delete or let expire the job according to your retention practice, and log the query id with your run so a failure can be traced.
  7. 7Wrap token refresh, retries and a timeout around the loop so a long query does not leave a script polling forever.

Why the API is asynchronous

Compass is built on a distributed query engine over files stored in the Data Lake, so a query can take from a second to many minutes depending on the volume scanned. The API therefore returns immediately with a job reference instead of holding an HTTP connection open. This is also why a naive script that expects rows in the first response sees an empty body or a status field and nothing else.

Because the job is separate from the result, you can submit several queries, poll them in parallel and fetch results as each finishes. Keep concurrency modest. Compass shares capacity with other users of the tenant, and bursts of heavy queries show up as queued jobs rather than errors.

import time, requests

BASE = 'https://mingle-ionapi.inforcloudsuite.com/ACME_PRD/DATAFABRIC/compass/v2'
H = {'Authorization': 'Bearer ' + token, 'Content-Type': 'text/plain'}

r = requests.post(BASE + '/jobs/', data=sql, headers=H)
r.raise_for_status()
qid = r.json()['queryId']

while True:
    s = requests.get(BASE + '/jobs/' + qid + '/', headers=H).json()
    if s['status'] == 'FINISHED':
        break
    if s['status'] in ('FAILED', 'CANCELED'):
        raise RuntimeError(s)
    time.sleep(3)

Paging results and typing

Result pages are requested with offset and limit parameters, and the job status reports the total row count when it finishes. Page until the count is reached. Do not stop on an empty page without checking the count, because a transient failure can look the same.

Values arrive as text in JSON. Cast dates and numerics in your own code or in the SQL itself, and keep an eye on null handling when you load into pandas or a warehouse. Data Lake objects loaded from ERP through Data Flows may carry audit columns and variations such as a deleted flag, so filter those explicitly if you want current records only.

Common failures

A 401 means the token expired or the account lacks Data Lake roles, a failed job usually carries a SQL error such as an unknown object or column, and a job that stays queued suggests capacity pressure or a very large scan. Select only the columns you need and filter on a partition-friendly or indexed column to cut scan time.

If a script works at night but fails in the morning, check whether other scheduled loads were running. For recurring exports, consider whether the Data Lake is the right source at all: a one-off scheduled query to a file may be simpler than a custom polling script.

Common pitfalls

  • !Expecting rows in the POST response. The first response is a job reference, not data.
  • !Polling with no timeout or backoff, which leaves jobs and scripts running when a query hangs.
  • !Selecting every column with no filter on large objects, which turns a quick check into a full scan.
  • !Ignoring the reported row count and treating one empty page as the end of the data.
  • !Assuming ERP deletes are reflected as removed rows. Check how the object marks deleted records.

How an ERP-grounded AI assistant handles this

An assistant that answers analytical questions from the Data Lake does the same three steps: build a SQL statement, submit the job, and read the pages. Grounded behaviour means it shows the SQL, runs under a read-only service account and states which Data Lake objects it used. ERPray is ERP-agnostic in its connectors and can be pointed at live ERP data directly when the Data Lake copy is too stale for the question.

Frequently asked questions

Is the Compass API synchronous?

No. You submit SQL and receive a job reference, then poll for completion and fetch the results in pages. Treat it like any asynchronous job API, with a timeout, retries on transient errors and logging of the query id.

How do I authenticate to Compass from Python?

Use the .ionapi file from a backend service app to request a token with the password grant, then send it as a Bearer token on every Compass call. Refresh before expiry on long running scripts.

Can I use JDBC instead of the REST API?

Yes, Infor provides a Compass JDBC driver for BI and SQL tools, which is usually easier for interactive work. The REST API suits scripts and services that need to submit jobs and control paging themselves.

Why does my query stay in a queued state?

The tenant queues work when capacity is busy. Reduce scan size, run outside peak load windows and avoid submitting many large jobs at once. If it stays queued for long periods, raise it with Infor support.

Related

How-to

How to query Infor Data Lake with Compass SQL

Compass is the SQL query layer in Infor OS for querying Infor Data Lake, where flattened copies of BODs published over ION are stored by Noun and Verb. Open a Compass SQL Workbench tab, browse the schema for the correct table, and run a filtered SELECT rather than pulling the full history, since Data Lake tables can hold years of append-only data.

How-to

Connect a Birst Space to Infor Data Lake and build a report

Birst is Infor's embedded BI layer, and the recommended way to report on live Data Lake data is a Live Access source inside a Birst Space rather than a static upload. Build the logical model over a filtered set of tables, apply row-level security, and publish the dashboard to a Ming.le homepage so users reach it without leaving Infor OS.

How-to

How to Create an .ionapi File and Service Account in Infor OS

An .ionapi file is a JSON credentials file you download from ION API after registering an Authorized App of type Backend Service and creating a service account for it. It carries the tenant, client id, client secret, the token and authorization endpoints, and the service account keys that your scripts or integrations use to request an OAuth 2.0 access token.

CIO briefing

Data Platform for ERP Data: Replica, Warehouse or Lakehouse

Start with the smallest thing that removes reporting load from the ERP: a read replica or vendor replication feed. Add a warehouse or lakehouse when you must join ERP data with other sources, keep history, or serve many consumers. Put a governed semantic layer on top, because raw ERP tables are not a usable analytics or AI interface on their own.

Error fix

Fix a 401 Unauthorized error from Infor ION API

A 401 from ION API almost always means the credentials in the .ionapi file no longer match what ION API Gateway expects - not that the password is simply wrong. Check whether the Authorized App or service account behind the file was revoked, regenerated, expired, or issued for a different tenant, then re-test with a direct OAuth2 client_credentials call before touching any calling code.

Error fix

Diagnose and fix a failed BOD document flow in ION Desk

A Document Flow showing Failed in ION Desk means a BOD (Business Object Document) stopped either at schema validation, at the mapping step, or at the target application. Open the failed instance's detail to see the exact failing element, fix the source data or mapping, then use Resubmit rather than re-triggering the original transaction to avoid duplicates.

AI for ERP

AI Agents Over Infor ION API, BODs, and the Infor Data Lake

Build AI agents on Infor ION API Gateway, BODs, and Data Lake, alongside or instead of Infor's own GenAI features, with your choice of model and hosting.

AI for ERP

AI for Infor LN: Sessions, BODs, and Engineer-to-Order Work

Add grounded AI to Infor LN 10.x or CloudSuite: natural-language answers over sessions and BODs, agents for project and engineer-to-order work, on-prem options.

Stuck on Infor Data Lake (Data Fabric)?

Talk to engineers who work inside Infor Data Lake (Data Fabric) every week, and who build private AI that answers these questions from your own ERP data.