Class InputFormats.BaseFormatDefn
- java.lang.Object
-
- org.apache.druid.catalog.model.table.InputFormats.BaseFormatDefn
-
- All Implemented Interfaces:
InputFormatDefn
- Direct Known Subclasses:
InputFormats.FlatTextFormatDefn,InputFormats.JsonFormatDefn
- Enclosing class:
- InputFormats
public abstract static class InputFormats.BaseFormatDefn extends Object implements InputFormatDefn
Base class for input format definitions.
-
-
Constructor Summary
Constructors Constructor Description BaseFormatDefn(List<TableFunction.ParameterDefn> parameters)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.apache.druid.data.input.InputFormatconvert(Map<String,Object> jsonMap, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)Convert a generic Java map of input format properties to an input format object.protected voidconvertColumns(Map<String,Object> jsonMap, List<ColumnSpec> columns)Convert columns from theColumnSpecformat used by the catalog to the list of names form requires by input formats.org.apache.druid.data.input.InputFormatconvertFromTable(ResolvedExternalTable table)Create an input format from a resolved catalog table spec.protected abstract Class<? extends org.apache.druid.data.input.InputFormat>inputFormatClass()The target input format class for Jackson conversions.List<TableFunction.ParameterDefn>parameters()Obtain the parameters used to fully define an input format in a SQL function that defines an external table from scratch.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 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
-
-
-
-
Constructor Detail
-
BaseFormatDefn
public BaseFormatDefn(List<TableFunction.ParameterDefn> parameters)
-
-
Method Detail
-
parameters
public List<TableFunction.ParameterDefn> parameters()
Description copied from interface:InputFormatDefnObtain the parameters used to fully define an input format in a SQL function that defines an external table from scratch. Note that the final list of table function arguments combines parameters from all the various input sources. It is legal for multiple formats to define the same parameter, as long as both definitions are of the same type.- Specified by:
parametersin interfaceInputFormatDefn- Returns:
-
inputFormatClass
protected abstract Class<? extends org.apache.druid.data.input.InputFormat> inputFormatClass()
The target input format class for Jackson conversions.
-
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
-
convertColumns
protected void convertColumns(Map<String,Object> jsonMap, List<ColumnSpec> columns)
Convert columns from theColumnSpecformat used by the catalog to the list of names form requires by input formats.
-
convert
public org.apache.druid.data.input.InputFormat convert(Map<String,Object> jsonMap, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
Convert a generic Java map of input format properties to an input format object.
-
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- 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
-
-