Class ResolvedExternalTable
java.lang.Object
org.apache.druid.catalog.model.table.ResolvedExternalTable
Internal class to hold the intermediate form of an external table: the
input source and input format properties converted to Java maps, and the
types of each resolved to the corresponding definitions. Used to validate
a table specification, and to convert a table specification to an
ExternalTableSpec when used in SQL.-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a resolved external table by extracting the input source and input format properties, and converting each to a Java map. -
Method Summary
Modifier and TypeMethodDescriptionconvert()Return theExternalTableSpecfor a catalog entry for a this object which must be a fully-defined table.resolve(TableDefnRegistry registry) Look up the input source type and input format type to find the corresponding definitions in the table registry.tableFn()Return a table function definition for a partial table as given by this object.voidvalidate(TableDefnRegistry registry) Validate that the table spec is correct by resolving the definitions, then converting the JSON to the desired object type.
-
Field Details
-
inputSourceMap
-
inputFormatMap
-
-
Constructor Details
-
ResolvedExternalTable
Construct a resolved external table by extracting the input source and input format properties, and converting each to a Java map. Validates that the input source is present: the format is optional.Note: does not resolve the input source and input format definitions: that is done as a separate step when needed.
-
-
Method Details
-
resolvedTable
-
resolve
Look up the input source type and input format type to find the corresponding definitions in the table registry. Throws an exception if the types are not defined. The input source is required, the format is optional.Note, for resolution to work, the name of each definition must be the same as that used as the type key in the serialized JSON.
-
validate
Validate that the table spec is correct by resolving the definitions, then converting the JSON to the desired object type. Note that this path requires special handling: the table spec may be partial, which means it is missing information needed to create a complete input source. The input source definition defines which values can be omitted, and defined later in SQL via function parameters. If those values are missing, then the input source defn should provide dummy values so that the validation will succeed (assuming that the properties that are provided are valid.) -
tableFn
Return a table function definition for a partial table as given by this object. The function defines parameters to gather the values needed to convert the partial table into a fully-defined table which can be converted to anExternalTableSpec. -
convert
Return theExternalTableSpecfor a catalog entry for a this object which must be a fully-defined table.
-