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
Base class for input format definitions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConvert 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.Create an input format from a resolved catalog table spec.protected abstract Class<? extends InputFormat>The target input format class for Jackson conversions.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, waitMethods inherited from interface org.apache.druid.catalog.model.table.InputFormatDefn
convertFromArgs, typeValue
-
Constructor Details
-
BaseFormatDefn
-
-
Method Details
-
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
The target input format class for Jackson conversions. -
validate
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
Convert columns from theColumnSpecformat used by the catalog to the list of names form requires by input formats. -
convert
public 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
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
-