Dremio Community,
I would like to create a dataset in Dremio via REST API doing the following.
- Upload file (.csv) to S3 type data source.
- Convert file to a DataSet
a. Get the id of the physical file via REST API:
GET http://:port/api/v3/catalog/by-path/DQ Metrics/dataqueryplatform-dev-jsondata2/turik/data/uscities-1
Result:
{“entityType”:“file”,“id”:“dremio:/DQ Metrics/dataqueryplatform-dev-jsondata2/turik/data/“uscities-1"”,“path”:[“DQ Metrics”,“dataqueryplatform-dev-jsondata2”,“turik”,“data”,”“uscities-1"”]}
b. Promote the file to a Dataset via REST API
POST http://server:port/api/v3/catalog/by-path/DQ Metrics/dataqueryplatform-dev-jsondata2/turik/data/uscities-1
{
“entityType”: “dataset”,
“id”: “dremio:/DQ Metrics/dataqueryplatform-dev-jsondata2/turik/data/“uscities-1"”,
“type”: “PHYSICAL_DATASET”,
“path”: [
“DQ Metrics”,
“dataqueryplatform-dev-jsondata2”,
“turik”,
“data”,
““uscities-1"”
],
“format”: {
“type”: “Text”,
“fieldDelimiter”: “,”,
“lineDelimiter”: “\r\n”,
“quote”: “””,
“comment”: “#”,
“escape”: “””,
“skipFirstLine”: true,
“extractHeader”: true,
“trimHeader”: true,
“autoGenerateColumnNames”: true
}
}
Result:
{“errorMessage”:“Something went wrong”,“moreInfo”:“HTTP 405 Method Not Allowed”}
However, I am not able to complete step 2b. I suspect there is a problem with the
{id}. Is the id ok?
Also, Please confirm that promotion of a file should be HTTP Method ‘POST’.
Please advise.