CsvFileCommitter
Local comma-separated values files.
Notesβ
Commits crawled documents to local comma-separated values (CSV) files. Supports configurable delimiters, quoting, column mappings, multi-value joining, file compression, and output directory settings.
Examplesβ
- YAML
- JSON
- XML
class: CsvFileCommitter
filePath: /path/to/committer.csv
{
"class": "CsvFileCommitter",
"filePath": "/path/to/committer.csv"
}
<class>CsvFileCommitter</class>
<filePath>/path/to/committer.csv</filePath>
Usageβ
Full configuration skeleton, with every option and its default
- YAML
- JSON
- XML
class: CsvFileCommitter
columns:
- field: string
header: string
truncateAt: 0
compress: false
delimiter: string
directory: string
docsPerFile: 0
escape: string
fieldMappings: {}
fileNamePrefix: string
fileNameSuffix: string
format: DEFAULT
multiValueJoinDelimiter: string
quote: string
restrictions:
- fieldMatcher: {}
valueMatcher: {}
showHeaders: false
splitUpsertDelete: false
truncateAt: 0
typeHeader: string
{
"class": "CsvFileCommitter",
"columns": [
{
"field": "string",
"header": "string",
"truncateAt": 0
}
],
"compress": false,
"delimiter": "string",
"directory": "string",
"docsPerFile": 0,
"escape": "string",
"fieldMappings": {},
"fileNamePrefix": "string",
"fileNameSuffix": "string",
"format": "DEFAULT",
"multiValueJoinDelimiter": "string",
"quote": "string",
"restrictions": [
{
"fieldMatcher": {},
"valueMatcher": {}
}
],
"showHeaders": false,
"splitUpsertDelete": false,
"truncateAt": 0,
"typeHeader": "string"
}
<csvFileCommitter>
<class>CsvFileCommitter</class>
<columns>
<column>
<field>string</field>
<header>string</header>
<truncateAt>0</truncateAt>
</column>
</columns>
<compress>false</compress>
<delimiter>string</delimiter>
<directory>string</directory>
<docsPerFile>0</docsPerFile>
<escape>string</escape>
<fieldMappings/>
<fileNamePrefix>string</fileNamePrefix>
<fileNameSuffix>string</fileNameSuffix>
<format>DEFAULT</format>
<multiValueJoinDelimiter>string</multiValueJoinDelimiter>
<quote>string</quote>
<restrictions>
<restriction>
<fieldMatcher/>
<valueMatcher/>
</restriction>
</restrictions>
<showHeaders>false</showHeaders>
<splitUpsertDelete>false</splitUpsertDelete>
<truncateAt>0</truncateAt>
<typeHeader>string</typeHeader>
</csvFileCommitter>
Propertiesβ
| Property | Type | Required | Default |
|---|---|---|---|
columns | CsvColumn[] | No | - |
compress | boolean | No | false |
delimiter | string | No | - |
directory | string | No | - |
docsPerFile | integer | No | 0 |
escape | string | No | - |
fieldMappings | Record<string, string> | No | - |
fileNamePrefix | string | No | - |
fileNameSuffix | string | No | - |
format | enum | No | - |
multiValueJoinDelimiter | string | No | - |
quote | string | No | - |
restrictions | PropertyMatcher[] | No | - |
showHeaders | boolean | No | false |
splitUpsertDelete | boolean | No | false |
truncateAt | integer | No | 5096 |
typeHeader | string | No | - |
Property Detailsβ
columnsβ
Target columns for desired document field values.
compressβ
Compress the generated CSV files using the GZIP file format.
delimiterβ
Delimiter
directoryβ
Local path where CSV files will be written.
docsPerFileβ
Maximum number of documents per CSV files.
escapeβ
The escape character to use when needed.
fieldMappingsβ
Mapping of source fields to target ones (CSV columns).
fileNamePrefixβ
A string prepended to generated file names to distinguish them from other output files.
fileNameSuffixβ
A string appended to generated file names (before the extension) to distinguish them from other output files.
formatβ
Configuration presets optimized for specific applications consuming CSV files.
Allowed Valuesβ
DEFAULTEXCELINFORMIX_UNLOAD1_3INFORMIX_UNLOAD_CSV1_3MONGO_CSV1_7MONGO_TSV1_7MYSQLORACLE1_6POSTGRESSQL_CSV1_5POSTGRESSQL_TEXT1_5RFC_4180TDF
multiValueJoinDelimiterβ
One or more characters to be used as a delimiter when combining multi-value fields to become single-value.
quoteβ
A character used to quote values.
restrictionsβ
Defines filter conditions that restrict which documents this committer processes. Documents not matching the restrictions are ignored by this committer.
showHeadersβ
Write column headers at the first of a generated document.
splitUpsertDeleteβ
When enabled, a single update operation is split into separate upsert and delete operations for compatibility with the target system.
truncateAtβ
Truncate values larger than N characters. Default is 5096. Use -1 for unlimited.
typeHeaderβ
Name of the column holding the operation type (upsert or delete). Default is type.