Hi,
I am trying to use the the Dremio REST API (through the Python package), and I am having a hard time getting my API call to work. I believe there is some problem in the way I am quoting the name/path of the dataset, but I can’t figure out what exactly the problem is:
Following the last comment in this post:
I’m using the following call:
curl --location --request POST ‘http://eellsworthdev:9047/api/v3/catalog/dremio%3A%2F"Checkbook_cataloged_data"%2F"RxTerms"%2F"run_5930_2019-10-31-144718"%2Ffile_88163_RxTermsArchive201910.txt’
–header ‘Accept: /’
–header ‘Accept-Encoding: gzip, deflate’
–header ‘Connection: keep-alive’
–header ‘Content-Length: 517’
–header ‘User-Agent: python-requests/2.25.1’
–header ‘content-type: application/json’
–data-raw ‘{“entityType”: “dataset”,
“id”: “dremio:/Checkbook_cataloged_data/RxTerms/"run_5930_2019-10-31-144718"/file_88163_RxTermsArchive201910.txt”,
“path”: [“"Checkbook_cataloged_data"”,
“"RxTerms"”,
“"run_5930_2019-10-31-144718"”,
“file_88163_RxTermsArchive201910.txt”]
,
“type”: “PHYSICAL_DATASET”,
“format”: {
“type”: “Text”,
“fieldDelimiter”: “|”,
“lineDelimiter”: “\r\n”,
“quote”: “"”,
“comment”: “#”,
“escape”: “"”,
“skipFirstLine”: false,
“extractHeader”: true,
“trimHeader”: true,
“autoGenerateColumnNames”: true
}
}’
which produces this error:
Unrecognized token ‘tru’: was expecting (JSON String, Number, Array, Object or token ‘null’, ‘true’ or ‘false’)
at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 17, column: 25] (through reference chain: com.dremio.dac.api.Dataset[“format”])
I have played around with all the combinations of URL encoding and quoting I can think of and I get similar errors.
Does anyone have any suggestions on how to resolve this?
Thanks!
Eric