CoxAutomotiveDataSolutions / waimak

Waimak is an open-source framework that makes it easier to create complex data flows in Apache Spark.
Apache License 2.0
75 stars 16 forks source link

Fix WriteAsNamedFilesAction to work with text format correctly #102

Closed jamesfielder closed 4 years ago

jamesfielder commented 4 years ago

Fix WriteAsNamedFilesAction to correctly find the written file when using the text format, and only allow one file to be written as text (mirroring spark).

Description

When writing text format we do not find the written files, as we assume that the format option ("text") is equal to the file extension ("txt"). This change checks the format and correctly finds txt files when asking for the text format. Also, the spark file writer cannot deal with writing more than 1 file, so we throw if requesting more than 1 file to be written.

Type of change

How Has This Been Tested?

Added unit tests to check this functionality.