Currently, there is no way for a user to specify the field delimiter for the writing records as a text output. Further more, if the fields contain the delimiter, we have no mechanism of specifying quotes.
By default, quotes should be used to enclose non-numeric fields being written.
Description of the implemented changes:
2 options are added to control text writer output:
store.text.writer.add_header - indicates if header should be added in created text file. Default is true.
store.text.writer.force_quotes - indicates if all value should be quoted. Default is false. It means only values that contain special characters (line / field separators) will be quoted.
Line / field separators, quote / escape characters can be configured using text format configuration using Web UI. User can create special format only for writing data and then use it when creating files. Though such format can be always used to read back written data.
Next set specified format and create text file:
1. To write data univocity-parsers are used, they limit line separator length to not more than 2 characters, though Drill allows setting more 2 chars as line separator since Drill can read data splitting by line separator of any length, during data write exception will be thrown.
2. extractHeader in text format configuration does not affect if header will be written to text file, only store.text.writer.add_header controls this action. extractHeader is used only when reading the data.