Class AbstractFlatTextFormatParser
java.lang.Object
org.apache.druid.java.util.common.parsers.AbstractFlatTextFormatParser
- Direct Known Subclasses:
CSVParser,DelimitedParser
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionAbstractFlatTextFormatParser(String listDelimiter, boolean hasHeaderRow, int maxSkipHeaderRows, boolean tryParseNumbers) -
Method Summary
Modifier and TypeMethodDescriptionReturns the fieldNames that we expect to see in parsed Maps, if known, or null otherwise.parseToMap(String input) Parse a String into a Map.voidsetFieldNames(Iterable<String> fieldNames) Set the fieldNames that you expect to see in parsed Maps.voidsetFieldNames(String header) voidThis method may or may not get called at the start of reading of every file depending on the type of IndexTasks.
-
Constructor Details
-
AbstractFlatTextFormatParser
public AbstractFlatTextFormatParser(@Nullable String listDelimiter, boolean hasHeaderRow, int maxSkipHeaderRows, boolean tryParseNumbers)
-
-
Method Details
-
startFileFromBeginning
public void startFileFromBeginning()Description copied from interface:ParserThis method may or may not get called at the start of reading of every file depending on the type of IndexTasks. The parser state should be reset if exists.- Specified by:
startFileFromBeginningin interfaceParser<String,Object>
-
getListDelimiter
-
getFieldNames
Description copied from interface:ParserReturns the fieldNames that we expect to see in parsed Maps, if known, or null otherwise. Deprecated; Parsers should not, in general, be expected to know what fields they will return.- Specified by:
getFieldNamesin interfaceParser<String,Object>
-
setFieldNames
Description copied from interface:ParserSet the fieldNames that you expect to see in parsed Maps. Deprecated; Parsers should not, in general, be expected to know what fields they will return. Some individual types of parsers do need to know (like a TSV parser) and those parsers have their own way of setting field names.- Specified by:
setFieldNamesin interfaceParser<String,Object>
-
setFieldNames
-
parseToMap
Description copied from interface:ParserParse a String into a Map. The result can be null which means the given input string will be ignored.- Specified by:
parseToMapin interfaceParser<String,Object>
-
parseLine
- Throws:
IOException
-