This procedure is used to export the result of a query into a CSV file.
A new procedure of type export.csv
named <id>
can be created as follows:
mldb.put("/v1/procedures/"+<id>, {
"type": "export.csv",
"params": {
"exportData": <InputQuery>,
"dataFileUrl": <Url>,
"headers": <bool>,
"delimiter": <string>,
"quoteChar": <string>,
"skipDuplicateCells": <bool>,
"runOnCreation": <bool>
}
})
with the following key-value definitions for params
:
Field, Type, Default | Description |
---|---|
exportData | An SQL query to select the data to be exported. This could be any query on an existing dataset. |
dataFileUrl | URL where the csv file should be written to. If a file already exists, it will be overwritten. |
headers | Whether to print headers |
delimiter | The delimiter to place between each value |
quoteChar | The character to enclose the values within when they contain either a delimiter or a quoteChar |
skipDuplicateCells | The CSV format cannot represent many values per cell the way MLDB datasets can by using the time dimension. When this parameter is set to To export a dataset that has more than one value in at least one cell, there are two options:
|
runOnCreation | If true, the procedure will be run immediately. The response will contain an extra field called |