streamsets

Target file name using file name expression in streamsets


I am trying to load the data from Google cloud-bucket to Local file system using below:

My Origin (Google Cloud Storage) Properties:

My Destination (Local FS) Properties:

But, The target file is not generating as sales.json, It is created as sdc-12ae0f4b-06ac-11ea-a26a-cf076a1f70a7_3d8447a7-19b6-4990-ac3b-daff4c4c2a7c

I want to generate the simple target file name as "sales.json"

Could someone help to generate.


Solution

  • It looks like you have a couple of things going on here:

    1. Check Files Prefix on the Local FS Output Files tab - this is likely set to the default, sdc-${sdc:id()}, which is producing the filename you are seeing.
    2. Use Preview to check that the /fileInfo/sales field is actually set. This field is not set by the Google Cloud Storage origin, so I assume you are setting it elsewhere in the pipeline.

    If you just want the output file to be sales.json, and not depend on anything in the whole file record, you can set File Name Expression to your desired filename.