Class LocalInputSourceDefn
java.lang.Object
org.apache.druid.catalog.model.table.BaseInputSourceDefn
org.apache.druid.catalog.model.table.FormattedInputSourceDefn
org.apache.druid.catalog.model.table.LocalInputSourceDefn
- All Implemented Interfaces:
InputSourceDefn
Definition for a
LocalInputSource.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.druid.catalog.model.table.BaseInputSourceDefn
BaseInputSourceDefn.AdHocTableFunction, BaseInputSourceDefn.PartialTableFunction -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringstatic final StringBase directory for file or filter operations.protected static final Stringstatic final Stringprotected static final Stringstatic final Stringstatic final StringFields inherited from class org.apache.druid.catalog.model.table.FormattedInputSourceDefn
FORMAT_PARAMETER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<TableFunction.ParameterDefn>Overridden by subclasses to provide the list of table function parameters for this specific input format.protected voidauditInputSource(Map<String, Object> jsonMap) Optional step to audit or adjust the input source properties prior to conversion via Jackson.protected voidConvert SQL arguments to the corresponding "generic JSON" form in the given map.protected ExternalTableSpecconvertCompletedTable(ResolvedExternalTable table, Map<String, Object> args, List<ColumnSpec> columns) Complete a partial table using the table function arguments and columns provided.Convert a complete (that is, fully-defined) table spec to an external table spec.protected Class<? extends InputSource>Overridden by each subclass to return the input source class to be used for JSON conversions.Provide a definition for a SQL table function that completes a partial table spec from the catalog.Type value for this format: same as the type string used in the serialized JSON for this input source.voidvalidate(ResolvedExternalTable table) Given a external table catalog spec, with the JSON input source and format properties parsed to generic Java maps, validate that the properties are valid prior to saving the spec into the catalog.Methods inherited from class org.apache.druid.catalog.model.table.FormattedInputSourceDefn
addFormatParameters, bind, convertArgsToFormat, convertPartialFormattedTable, convertTableToFormat, defineAdHocTableFunctionMethods inherited from class org.apache.druid.catalog.model.table.BaseInputSourceDefn
adHocTableFn, convertArgsToSource, convertArgsToTable, convertSource, convertTableToSource, selectPartialTableColumns
-
Field Details
-
TYPE_KEY
- See Also:
-
BASE_DIR_PARAMETER
Base directory for file or filter operations. If not provided, then the servers current working directory is assumed, which is typically valid only for sample data.- See Also:
-
FILTER_PARAMETER
- See Also:
-
FILES_PARAMETER
- See Also:
-
BASE_DIR_FIELD
- See Also:
-
FILES_FIELD
- See Also:
-
FILTER_FIELD
- See Also:
-
-
Constructor Details
-
LocalInputSourceDefn
public LocalInputSourceDefn()
-
-
Method Details
-
typeValue
Description copied from interface:InputSourceDefnType value for this format: same as the type string used in the serialized JSON for this input source. Used as the key for this definition within the table registry, and associates the serialized JSON with the corresponding input source definition. -
inputSourceClass
Description copied from class:BaseInputSourceDefnOverridden by each subclass to return the input source class to be used for JSON conversions.- Specified by:
inputSourceClassin classBaseInputSourceDefn
-
validate
Description copied from interface:InputSourceDefnGiven a external table catalog spec, with the JSON input source and format properties parsed to generic Java maps, validate that the properties are valid prior to saving the spec into the catalog.- Specified by:
validatein interfaceInputSourceDefn- Overrides:
validatein classFormattedInputSourceDefn- Parameters:
table- a catalog table spec with the input source and input format properties parsed into generic Java maps
-
adHocTableFnParameters
Description copied from class:FormattedInputSourceDefnOverridden by subclasses to provide the list of table function parameters for this specific input format. This list is combined with parameters for input formats. The method is called only once per run.- Specified by:
adHocTableFnParametersin classFormattedInputSourceDefn
-
convertArgsToSourceMap
Description copied from class:BaseInputSourceDefnConvert SQL arguments to the corresponding "generic JSON" form in the given map. The map will then be adjusted and converted to the actual input source.- Specified by:
convertArgsToSourceMapin classBaseInputSourceDefn
-
partialTableFn
Description copied from interface:InputSourceDefnProvide a definition for a SQL table function that completes a partial table spec from the catalog. Used when the spec represents a "partial table" or a "connection". The function provides parameters needed to complete the table (typically the set of input files, objects, etc.) If the catalog table spec does not provide a format, and this input source requires a format, then the parameters also include parameters for all supported input formats, same as forInputSourceDefn.adHocTableFn().- Parameters:
table- a catalog table spec with the input source and input format properties parsed into generic Java maps- Returns:
- a fully-defined external table to be handed off to the Calcite planner.
-
convertCompletedTable
protected ExternalTableSpec convertCompletedTable(ResolvedExternalTable table, Map<String, Object> args, List<ColumnSpec> columns) Description copied from class:BaseInputSourceDefnComplete a partial table using the table function arguments and columns provided. The arguments match the set of parameters used for the function. The columns are provided if the SQL included anEXTENDSclause: the implementation should decide if columns are required (or allowed) depending on whether the partial spec already defines columns.- Specified by:
convertCompletedTablein classBaseInputSourceDefn- Parameters:
table- the partial table spec, with input source and format parsed into a generic Java mapargs- the argument values provided in the SQL table function call. The arguments use the Java types defined in the parameter definitions.columns- the set of columns (if any) from the SQLEXTENDclause- Returns:
- an external table spec which Calcite can consume
-
auditInputSource
Description copied from class:BaseInputSourceDefnOptional step to audit or adjust the input source properties prior to conversion via Jackson. Changes are made directly in thejsonMap.- Overrides:
auditInputSourcein classBaseInputSourceDefn
-
convertTable
Description copied from interface:InputSourceDefnConvert a complete (that is, fully-defined) table spec to an external table spec. Used when SQL references the catalog table directly by name in theFROMclause without using a table function.- Specified by:
convertTablein interfaceInputSourceDefn- Overrides:
convertTablein classBaseInputSourceDefn- Returns:
- a fully-defined external table to be handed off to the Calcite planner.
-