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
[x] Bug fix (non-breaking change which fixes an issue)
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.