Class AbstractFlatTextFormatParser
- java.lang.Object
-
- org.apache.druid.java.util.common.parsers.AbstractFlatTextFormatParser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractFlatTextFormatParser.FlatTextFormat
-
Constructor Summary
Constructors Constructor Description AbstractFlatTextFormatParser(String listDelimiter, boolean hasHeaderRow, int maxSkipHeaderRows)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description List<String>
getFieldNames()
Returns the fieldNames that we expect to see in parsed Maps, if known, or null otherwise.String
getListDelimiter()
protected abstract List<String>
parseLine(String input)
Map<String,Object>
parseToMap(String input)
Parse a String into a Map.void
setFieldNames(Iterable<String> fieldNames)
Set the fieldNames that you expect to see in parsed Maps.void
setFieldNames(String header)
void
startFileFromBeginning()
This method may or may not get called at the start of reading of every file depending on the type of IndexTasks.
-
-
-
Method Detail
-
startFileFromBeginning
public void startFileFromBeginning()
Description copied from interface:Parser
This 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:
startFileFromBeginning
in interfaceParser<String,Object>
-
getListDelimiter
public String getListDelimiter()
-
getFieldNames
public List<String> getFieldNames()
Description copied from interface:Parser
Returns 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:
getFieldNames
in interfaceParser<String,Object>
-
setFieldNames
public void setFieldNames(Iterable<String> fieldNames)
Description copied from interface:Parser
Set 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:
setFieldNames
in interfaceParser<String,Object>
-
setFieldNames
public void setFieldNames(String header)
-
parseToMap
public Map<String,Object> parseToMap(String input)
Description copied from interface:Parser
Parse a String into a Map. The result can be null which means the given input string will be ignored.- Specified by:
parseToMap
in interfaceParser<String,Object>
-
parseLine
protected abstract List<String> parseLine(String input) throws IOException
- Throws:
IOException
-
-