Export data to external location from an output of a method on c3typ

I am looking to export data to a external file store location. The data is an output of a method on a c3type which is a C3dataset. I have tried the following methods:

  1. c3CSV(dataset)
    This generates the dataset locally and not to a file store location

  2. How to Build a Export BatchJob
    This case is not applicable here as the data contains instances of a c3type but not a method on C3type

  3. I am looking for something similar to this:
    How to run a BatchExport job on a custom defined function

c3type: CompressorModel
method on c3type: getMLPredictdata(CompressorModelPredictionSpec)
c3type CompressorModelPredictionSpec contains a timerange with a start and an end
file output typerequired is a csv.

    "type": {
        "name": "BatchExportSpec"
    "contentEncoding": "gzip", 
    "contentType": "csv", 
    "deleteExisting": true, 
    "numFiles": 1, 
    "targetAction": {
        "type": {
            "name": "PartiallyAppliedAction"
        "actionName": "getMLPredictdata", 
        "args": {
            "spec": {
                "type": {
                    "name": "CompressorModelPredictionSpec"
                "end": "2018-04-01T00:00:00",  
                "start": "2018-01-01T00:00:00"
        "typeName": "CompressorModel"
    "targetPath": "TestBatchExport_Predictdata"

per @kaipo.lucas,
Give this a try (I have done this successfully):

model =  CompressorModel.get('model_id');
predictionSpec = <<make a prediction spec>>
result = model.getMLPredictData(predictionSpec);
var file = FileSystem.makeFile('azure://<<env_path>>/dl/dlTest.txt');

Then follow the instructions here to locate the file: