- All Known Implementing Classes:
JsonPatternBasedDiscovery,PatternBasedDiscovery
public interface TextRecordDiscoverer
A generator of text record schemas. A
TextRecordDiscoverer
can be used with delimited text data to produce schemas for
reading and writing.-
Method Summary
Modifier and TypeMethodDescriptiondiscoverForRead(List<List<String>> rows, boolean containsHeader, TextConversionDefaults defaults) Constructs a schema for reading based on the given file analysis.generateForWrite(RecordTokenType recordTokenType, TextConversionDefaults defaults) Constructs a schema for writing based on the given record type.
-
Method Details
-
discoverForRead
TextRecord discoverForRead(List<List<String>> rows, boolean containsHeader, TextConversionDefaults defaults) Constructs a schema for reading based on the given file analysis. The analysis may or may not include a header row, as indicated.- Parameters:
rows- the analyzed rows from a text filecontainsHeader- indicates whether the first row of the analyzed file is a headerdefaults- defaults for the discovered schema- Returns:
- a schema appropriate for reading the file.
-
generateForWrite
Constructs a schema for writing based on the given record type.- Parameters:
recordTokenType- the record type of the datadefaults- defaults for the discovered schema- Returns:
- a schema appropriate for writing data of the given type
-