Hello,
I am trying to create reflection using api.
I am sending a post request to dremio server/api/v3/reflection endpoint, with following body
{
name: ‘RAW Reflection’,
type: ‘RAW’,
enabled: false,
datasetId: “ecc5e46c-983b-4a5a-a21f-e853b4f64656”,
partitionDistributionStrategy: ‘CONSOLIDATED’
}
But I got “status:400, statusText:Bad Request”, seems I am missing something obvious, any hint?
@marvinwu
Is “ecc5e46c-983b-4a5a-a21f-e853b4f64656” the reflection ID or dataset ID?
Thanks
@balaji.ramaswamy
doron
3
You need to provide at least one column when creating RAW reflections and you should also provide the entityType
:
{
"type":"RAW",
"name":"Raw Reflection",
"datasetId":"d45c6604-3d88-41f4-8d0-0253076e6e52",
"enabled":true,
"displayFields":[{"name":"name"}],
"partitionDistributionStrategy":"CONSOLIDATED",
"entityType":"reflection"
}
@balaji.ramaswamy, it is datasetId
thanks much Doron! It worked after I added displayFields
probably good to update the docs as welll, the display Fields listed as optional, but it is actually required for RAW type reflection.
https://docs.dremio.com/rest-api/reflections/post-reflection.html