Skip to main content
Solved

How to reference CSV from Writer for S3Connector?


Forum|alt.badge.img+1

How can I reference the CSV created from a Writer to upload to AWS S3 using S3Connector? I can successfully use a Reader to reference a file on my computer and upload to AWS S3 using my Web Connection and S3Connector, but I don't know how to reference a newly created file within my worflow. See attached.

Best answer by chrisatsafe

Hi @osdev​ ,

You'll likely want to use a FeatureWriter instead. The FeatureWriter is essentially the transformer version of a writer which allows you to continue processing after a file has been created. If you replace your CSV writer with a FeatureWriter, you can simply connect the summary port to the S3Connector and use the summary attribute _dataset to set the file to upload (i.e. @Value(_dataset)\\<filename>.csv).

imageIf you want to only create a temporary csv you can also mix in a TempPathnameCreator.

 

View original
Did this help you find an answer to your question?

2 replies

chrisatsafe
Contributor
Forum|alt.badge.img+2
  • Contributor
  • Best Answer
  • March 23, 2022

Hi @osdev​ ,

You'll likely want to use a FeatureWriter instead. The FeatureWriter is essentially the transformer version of a writer which allows you to continue processing after a file has been created. If you replace your CSV writer with a FeatureWriter, you can simply connect the summary port to the S3Connector and use the summary attribute _dataset to set the file to upload (i.e. @Value(_dataset)\\<filename>.csv).

imageIf you want to only create a temporary csv you can also mix in a TempPathnameCreator.

 


Forum|alt.badge.img+1
  • Author
  • March 23, 2022

The FeatureWriter transformer worked great! Thank you.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings