Class InputFormats.FlatTextFormatDefn
- java.lang.Object
-
- org.apache.druid.catalog.model.table.InputFormats.BaseFormatDefn
-
- org.apache.druid.catalog.model.table.InputFormats.FlatTextFormatDefn
-
- All Implemented Interfaces:
InputFormatDefn
- Direct Known Subclasses:
InputFormats.CsvFormatDefn,InputFormats.DelimitedFormatDefn
- Enclosing class:
- InputFormats
public abstract static class InputFormats.FlatTextFormatDefn extends InputFormats.BaseFormatDefn
Definition of a flat text (CSV and delimited text) input format.Note that not all the fields in
FlatTextInputFormatappear here:findColumnsFromHeader- not yet supported in MSQ.hasHeaderRow- Always set to false since we don't bother to read it.skipHeaderRowsis used to specify the number of header rows to skip.
-
-
Field Summary
Fields Modifier and Type Field Description static StringLIST_DELIMITER_PARAMETERstatic StringSKIP_ROWS_PARAMETER
-
Constructor Summary
Constructors Constructor Description FlatTextFormatDefn(List<TableFunction.ParameterDefn> parameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidadjustValues(Map<String,Object> jsonMap)org.apache.druid.data.input.InputFormatconvertFromTable(ResolvedExternalTable table)Create an input format from a resolved catalog table spec.protected Map<String,Object>mapFromArgs(Map<String,Object> args, List<ColumnSpec> columns)protected Map<String,Object>toMap(ResolvedExternalTable table)voidvalidate(ResolvedExternalTable table)Given a resolved table that has the serialized JSON converted to a Java map, validate the values of that map, typically by converting that map the target input format object (after adjustments and filling in dummy columns.) THe goal is to validate the information the user has provided in the table spec.-
Methods inherited from class org.apache.druid.catalog.model.table.InputFormats.BaseFormatDefn
convert, convertColumns, inputFormatClass, parameters
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.catalog.model.table.InputFormatDefn
convertFromArgs, typeValue
-
-
-
-
Field Detail
-
LIST_DELIMITER_PARAMETER
public static final String LIST_DELIMITER_PARAMETER
- See Also:
- Constant Field Values
-
SKIP_ROWS_PARAMETER
public static final String SKIP_ROWS_PARAMETER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FlatTextFormatDefn
public FlatTextFormatDefn(List<TableFunction.ParameterDefn> parameters)
-
-
Method Detail
-
validate
public void validate(ResolvedExternalTable table)
Description copied from interface:InputFormatDefnGiven a resolved table that has the serialized JSON converted to a Java map, validate the values of that map, typically by converting that map the target input format object (after adjustments and filling in dummy columns.) THe goal is to validate the information the user has provided in the table spec. The final format information is validated elsewhere.- Specified by:
validatein interfaceInputFormatDefn- Overrides:
validatein classInputFormats.BaseFormatDefn
-
toMap
protected Map<String,Object> toMap(ResolvedExternalTable table)
-
mapFromArgs
protected Map<String,Object> mapFromArgs(Map<String,Object> args, List<ColumnSpec> columns)
-
convertFromTable
public org.apache.druid.data.input.InputFormat convertFromTable(ResolvedExternalTable table)
Description copied from interface:InputFormatDefnCreate an input format from a resolved catalog table spec. The format is given by the Java map within the given object.- Specified by:
convertFromTablein interfaceInputFormatDefn- Overrides:
convertFromTablein classInputFormats.BaseFormatDefn- Parameters:
table- resolved form of a table spec, with the format JSON parsed into a JSON map- Returns:
- an input format as defined by the table spec
-
-