Recommendations
Use the Recommendations API to submit job IDs of jobs that ran SQL queries, and receive recommendations for aggregation reflections that can accelerate those queries.
For more information, see Sending Requests to the Recommendations API.
Recommendation Object{
"data": [
{
"viewRequestBody": {
"entityType": "dataset",
"path": [
"recommended_view",
"Dataset_be919a56-f18b-421b-9612-711a1cc51b69"
],
"type": "VIRTUAL_DATASET",
"sql": "SELECT * FROM Samples.samples.dremio.com.\"NYC-taxi-trips\" WHERE trip_distance_mi <= 2.0 ORDER BY trip_distance_mi ASC",
}
"viewRequestEndpoint": "POST {hostname}/api/v3/catalog",
"reflectionRequestBody": {
"type": "AGGREGATION",
"name": "agg_250e70d1-5e2a-4938-a1a1-95f664085099",
"datasetId": "be919a56-f18b-421b-9612-711a1cc51b69",
"enabled": true,
"dimensionFields": [
{
"name": "passenger_count",
"granularity": "DATE"
}
],
"measureFields": [
{
"name": "fare_amount",
"measureTypeList": [
"SUM",
"COUNT"
]
}
],
"entityType": "reflection"
}
"reflectionRequestEndpoint": "POST {hostname}/api/v3/reflection"
}
],
"canAlterReflections": true
}
Recommendation Attributes
viewRequestBody Array of Object
The fields that you can include in a request to the Catalog API for creating the view on which to define the recommended aggregation reflection.
For descriptions of these fields, see View.
viewRequestEndpoint String
The endpoint to use when submitting the request to the Catalog API to create the view on which to define the reflection.
reflectionRequestBody Array of Object
The fields that you can include in a request to the Reflection API for creating the recommended aggregation reflection.
For descriptions of these fields, see Reflection.
reflectionRequestEndpoint String
The endpoint to use when submitting the request to the Reflection API to create the aggregation reflection.
canAlterReflections String
Indicates whether the columns in the reflection can be edited, and whether columns can be added or removed.
Requesting Recommendations
Request recommended aggregation reflections to accelerate the queries associated with the provided job ID or IDs.
Method and URLPOST /api/v3/reflection/recommendations
Parameters
jobIds Data Array of String
A list of the job IDs of jobs that have run the SQL commands that you want to receive one or more recommended reflections for.
Example Requestcurl -X POST 'https://{hostname}/api/v3/reflection/recommendations' \
--header 'Authorization: Bearer <PersonalAccessToken>' \
--header 'Content-Type: application/json' \
--data
'{
"jobIds": [
"1a515250-7572-0f9b-f5e5-89f505b55200",
"1a515292-583c-e407-79ef-9f9b494fa600"
]
}'