@@ -160,34 +160,78 @@ formatTypeOptions ::=
160160 RECORD_DELIMITER = '<character>'
161161 FIELD_DELIMITER = '<character>'
162162 SKIP_HEADER = <integer>
163+ QUOTE = '<character>'
164+ ESCAPE = '<character>'
165+ NAN_DISPLAY = '<string>'
166+ ROW_TAG = '<string>'
163167 COMPRESSION = AUTO | GZIP | BZ2 | BROTLI | ZSTD | DEFLATE | RAW_DEFLATE | XZ | NONE
164168```
165169
166- #### ` RECORD_DELIMITER = '<character> '`
170+ #### ` TYPE = 'CSV '`
167171
168- Description: One character that separate records in an input file .
172+ Comma Separated Values format ( [ RFC ] ( https://www.rfc-editor.org/rfc/rfc4180 ) ) .
169173
170- Default: ` '\n' `
174+ some notice:
171175
172- #### ` FIELD_DELIMITER = '<character>' `
176+ 1 . a string field contains ` Quote ` |` Escape ` |` RECORD_DELIMITER ` |` RECORD_DELIMITER ` must be quoted.
177+ 2 . no character is escaped except ` Quote ` in quoted string.
178+ 3 . no space between ` FIELD_DELIMITER ` and ` Quote ` .
179+ 4 . no trailing ` FIELD_DELIMITER ` for a record.
180+ 5 . Array/Struct field is serialized to a string as in SQL, and then the resulting string is output to CSV in quotes.
181+ 6 . if you are generating CSV via programing, we highly recommend you to use the CSV lib of the programing language.
182+ 7 . for text file unloaded from [ MySQL] ( https://dev.mysql.com/doc/refman/8.0/en/load-data.html ) , the default format is
183+ TSV in databend. it is valid CSV only if ` ESCAPED BY ` is empty and ` ENCLOSED BY ` is not empty.
173184
174- Description: One character that separate fields in an input file.
185+ ##### ` RECORD_DELIMITER = '<character>' `
175186
176- Default: ` ',' ` (comma)
187+ ** Description** : One character that separate records in an input file.
188+ ** Supported Values** : ` \r\n ` or One character including escaped char: ` \b ` , ` \f ` , ` \r ` , ` \n ` , ` \t ` , ` \0 ` , ` \xHH `
189+ ** Default** : ` \n `
177190
178- #### ` SKIP_HEADER = '<integer >'`
191+ ##### ` FIELD_DELIMITER = '<character >'`
179192
180- Description: Number of lines at the start of the file to skip.
193+ ** Description** : One character that separate fields in an input file.
194+ ** Supported Values** : One character only, including escaped char: ` \b ` , ` \f ` , ` \r ` , ` \n ` , ` \t ` , ` \0 ` , ` \xHH `
195+ ** Default** : ` , ` (comma)
181196
182- Default: ` 0 `
197+ ##### ` Quote = '<character>' `
183198
184- #### ` COMPRESSION = AUTO | GZIP | BZ2 | BROTLI | ZSTD | DEFLATE | RAW_DEFLATE | XZ | NONE `
199+ ** Description ** : One character to quote strings in CSV file.
185200
186- Description: String that represents the compression algorithm.
201+ for data loading, quote is not necessary unless a string contains ` Quote ` | ` Escape ` | ` RECORD_DELIMITER ` | ` RECORD_DELIMITER `
187202
188- Default : ` NONE `
203+ ** Supported Values ** : ` \' ` or ` \" ` .
189204
190- Values:
205+ ** Default** : ` \" `
206+
207+ ##### ` ESCAPE = '<character>' `
208+
209+ ** Description** : One character to escape quote in quoted strings.
210+
211+ ** Supported Values** : ` \' ` or ` \" ` or ` \\ ` .
212+
213+ ** Default** : ` \" `
214+
215+ ##### ` SKIP_HEADER = '<integer>' `
216+
217+ ** Use** : Data loading only.
218+
219+ ** Description** : Number of lines at the start of the file to skip.
220+
221+ ** Default** : ` 0 `
222+
223+ ##### ` NAN_DISPLAY = '<string>' `
224+
225+ ** Supported Values** : must be literal ` 'nan' ` or ` 'null' ` (case-insensitive)
226+ ** Default** : ` 'NaN' `
227+
228+ ##### ` COMPRESSION = AUTO | GZIP | BZ2 | BROTLI | ZSTD | DEFLATE | RAW_DEFLATE | XZ | NONE `
229+
230+ ** Description** : String that represents the compression algorithm.
231+
232+ ** Default** : ` NONE `
233+
234+ ** Supported Values** :
191235
192236| Values | Notes |
193237| ------------- | --------------------------------------------------------------- |
@@ -201,6 +245,55 @@ Values:
201245| ` XZ ` | |
202246| ` NONE ` | Indicates that the files have not been compressed. |
203247
248+ #### ` TYPE = 'TSV' `
249+
250+ 1 . these characters are escaped: ` \b ` , ` \f ` , ` \r ` , ` \n ` , ` \t ` , ` \0 ` , ` \\ ` , ` \' ` , ` RECORD_DELIMITER ` ,` FIELD_DELIMITER ` .
251+ 2 . quoting/enclosing is not support now.
252+ 3 . Array/Struct field is serialized to a string as in SQL, and then the resulting string is output to CSV in quotes.
253+ 4 . Null is serialized as ` \N `
254+
255+ ##### ` RECORD_DELIMITER = '<character>' `
256+
257+ ** Description** : One character that separate records in an input file.
258+
259+ ** Supported Values** : ` \r\n ` or One character including escaped char: ` \b ` , ` \f ` , ` \r ` , ` \n ` , ` \t ` , ` \0 ` , ` \xHH `
260+
261+ ** Default** : ` \n `
262+
263+ ##### ` FIELD_DELIMITER = '<character>' `
264+
265+ ** Description** : One character that separate fields in an input file.
266+
267+ ** Supported Values** : One character only, including escaped char: ` \b ` , ` \f ` , ` \r ` , ` \n ` , ` \t ` , ` \0 ` , ` \xHH `
268+
269+ ** Default** : ` \t ` (TAB)
270+
271+ ##### ` COMPRESSION = AUTO | GZIP | BZ2 | BROTLI | ZSTD | DEFLATE | RAW_DEFLATE | XZ | NONE `
272+
273+ same as ` COMPRESSION ` in ` TYPE = 'CSV' `
274+
275+ #### ` TYPE = 'NDJSON' `
276+
277+ ##### ` COMPRESSION = AUTO | GZIP | BZ2 | BROTLI | ZSTD | DEFLATE | RAW_DEFLATE | XZ | NONE `
278+
279+ same as ` COMPRESSION ` in ` TYPE = 'CSV' `
280+
281+ #### ` TYPE = 'XML' `
282+
283+ ##### ` COMPRESSION = AUTO | GZIP | BZ2 | BROTLI | ZSTD | DEFLATE | RAW_DEFLATE | XZ | NONE `
284+
285+ same as ` COMPRESSION ` in ` TYPE = 'CSV' `
286+
287+ ##### ` ROW_TAG ` = ` <string> `
288+
289+ ** Description** : used to select XML elements to be decoded as a record.
290+
291+ ** Default** : ` 'row' `
292+
293+ #### ` TYPE = 'Parquet' `
294+
295+ No options available now.
296+
204297### copyOptions
205298
206299```
0 commit comments