EndsWithPatternInputFormat is used to parse a text file where the end of each record is identified by a specific
regular expression pattern.
Configuration
The configuration consists of the following parameters:
- hgrid247.record.endPattern
Indicates the regular expression pattern that marks the end of a record.
- hgrid247.record.patternFlag
Indicates the regular expression pattern flag.
- Default value: MULTILINE
- Multiple flags can be specified using the | separator.
- hgrid247.record.splitable
Indicates whether the input file is splittable.
- Default value: not splittable
- hgrid247.split.size
Indicates the size of a split (in bytes) when the input file is splittable.
- Default value: Hadoop block size
Example
Input Text File
2017-01-18;15:08:15.477 \B1.WWW01 IND.000.1000 6700
FR: LABS247 R: SOLUSI247
Uns:recpt prntr: Tran status 0, Paper ok c_00001
2017-01-18;15:08:15.485 \B1.S247 R: 3000 2017
Master socket caller 111117:192.168.1.1 detected c_00002
Configuration Used
| Configuration Name | Configuration Value |
| hgrid247.record.endPattern | \\sc_\\d\\d\\d\\d\\d |
Result
Record 1
2017-01-18;15:08:15.477 \B1.WWW01 IND.000.1000 6700
FR: LABS247 R: SOLUSI247
Uns:recpt prntr: Tran status 0, Paper ok c_00001
Record 2
2017-01-18;15:08:15.485 \B1.S247 R: 3000 2017
Master socket caller 111117:192.168.1.1 detected c_00002
Behavior
- Reads text files line by line
- Groups lines into records until the end-pattern is matched
- Outputs each detected record as a single unit
Typical Use Cases
- Parsing log files where records end with a known marker
- Processing transaction or audit logs with footer-based record boundaries
- Extracting multi-line records from unstructured text files