Accelerated queries endpoint
As part of the Data Distiller SKU, the Query Service API allows you to make stateless queries to the accelerated store. The returned results are based on aggregated data. The decreased latency of results allows for a more interactive exchange of information. The accelerated queries APIs are also used to power user-defined dashboards.
Before continuing with this guide, ensure that you have read and understood the Query Service API guide in order to successfully use Query Service API.
Getting started
The Data Distiller SKU is required to use the query accelerated store. Please see the packaging and guardrails, and licensing documentation that relates to the Data Distiller SKU. If you do not have the Data Distiller SKU please contact your Adobe customer service representative for more information.
The following sections detail the API calls necessary to access the query accelerated store in a stateless manner through the Query Service API. Each call includes the general API format, a sample request showing required headers, and a sample response.
Run an accelerated query run-accelerated-query
Make a POST request to the /accelerated-queries
endpoint to run an accelerated query. The query is either contained directly in the request payload or referenced with a template ID.
API format
POST /accelerated-queries
Request
/accelerated-queries
endpoint require either an SQL statement OR a template ID, but not both. Submitting both in a request causes an error.The following request submits an SQL query in the request body to the accelerated store.
curl -X POST https://platform.adobe.io/data/foundation/query/accelerated-queries
-H 'Authorization: {ACCESS_TOKEN}'
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-api-key: {API_KEY}'
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '
{
"dbName": "acmesbox1:acmeacceldb:accmeaggschema",
"sql": "SELECT * FROM accounts;",
"name": "Sample Accelerated Query",
"description": "A sample of an accelerated query."
}
'
This alternate request submits a template ID in the request body to the accelerated store. The SQL from the corresponding template is used to query the accelerated store.
curl -X POST https://platform.adobe.io/data/foundation/query/accelerated-queries
-H 'Authorization: {ACCESS_TOKEN}'
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-api-key: {API_KEY}'
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '
{
"dbName": "acmesbox1:acmeacceldb:accmeaggschema",
"templateId": "5d8228e7-4200-e3de-11e9-7f27416c5f0d",
"name": "Sample Accelerated Query",
"description": "A sample of an accelerated query."
}
'
dbName
dbName
should take the format of {SANDBOX_NAME}:{ACCELERATED_STORE_DATABASE}.{ACCELERATED_STORE_SCHEMA}
. The database provided must exist within the accelerated store or the request will result in an error. You must also ensure that the x-sandbox-name
header and sandbox name in dbName
refer to same sandbox.sql
templateId
/templates
endpoint.name
description
Response
A successful response returns HTTP status 200 with the ad hoc schema created by the query.
{
"queryId": "315a0a66-0fbb-4810-bc30-484cea5e0f1e",
"resultsMeta": {
"_adhoc": {
"type": "object",
"meta:xdmType": "object",
"properties": {
"Units": {
"type": "string",
"meta:xdmType": "string",
"default": null
},
"Industry_code_NZSIOC": {
"type": "string",
"meta:xdmType": "string",
"default": null
},
"Industry_name_NZSIOC": {
"type": "string",
"meta:xdmType": "string",
"default": null
},
"Variable_code": {
"type": "string",
"meta:xdmType": "string",
"default": null
},
"Variable_name": {
"type": "string",
"meta:xdmType": "string",
"default": null
},
"Industry_aggregation_NZSIOC": {
"type": "string",
"meta:xdmType": "string",
"default": null
},
"Value": {
"type": "string",
"meta:xdmType": "string",
"default": null
},
"Year": {
"type": "string",
"meta:xdmType": "string",
"default": null
},
"Variable_category": {
"type": "string",
"meta:xdmType": "string",
"default": null
},
"Industry_code_ANZSIC06": {
"type": "string",
"meta:xdmType": "string",
"default": null
}
}
}
},
"results": [
{
"Units": "Dollars (millions)",
"Industry_code_NZSIOC": "CC411",
"Industry_name_NZSIOC": "Printing",
"Variable_code": "H26",
"Variable_name": "Fixed tangible assets",
"Industry_aggregation_NZSIOC": "Level 4",
"Value": "282",
"Year": "2020",
"Variable_category": "Financial position",
"Industry_code_ANZSIC06": "ANZSIC06 groups C161 and C162"
},
{
"Units": "Dollars (millions)",
"Industry_code_NZSIOC": "CC411",
"Industry_name_NZSIOC": "Printing",
"Variable_code": "H27",
"Variable_name": "Additions to fixed assets",
"Industry_aggregation_NZSIOC": "Level 4",
"Value": "35",
"Year": "2020",
"Variable_category": "Financial position",
"Industry_code_ANZSIC06": "ANZSIC06 groups C161 and C162"
},
{
"Units": "Dollars (millions)",
"Industry_code_NZSIOC": "CC411",
"Industry_name_NZSIOC": "Printing",
"Variable_code": "H28",
"Variable_name": "Disposals of fixed assets",
"Industry_aggregation_NZSIOC": "Level 4",
"Value": "9",
"Year": "2020",
"Variable_category": "Financial position",
"Industry_code_ANZSIC06": "ANZSIC06 groups C161 and C162"
},
...
],
"request": {
"dbName": "acmesbox1:acmeacceldb:accmeaggschema",
"sql": "SELECT * FROM accounts;",
"name": "Sample Accelerated Query",
"description": "A sample of an accelerated query."
}
}
queryId
resultsMeta
resultsMeta._adhoc
resultsMeta._adhoc.type
resultsMeta._adhoc.meta:xdmType
resultsMeta._adhoc.properties
resultsMeta._adhoc.results