Class InlineInputSourceDefn

  • All Implemented Interfaces:
    InputSourceDefn

    public class InlineInputSourceDefn
    extends FormattedInputSourceDefn
    Describes an inline input source: one where the data is provided in the table spec as a series of text lines. Since the data is provided, the input format is required in the table spec: it cannot be provided at ingest time. Primarily for testing.
    • Constructor Detail

      • InlineInputSourceDefn

        public InlineInputSourceDefn()
    • Method Detail

      • typeValue

        public String typeValue()
        Description copied from interface: InputSourceDefn
        Type 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

        protected Class<? extends org.apache.druid.data.input.InputSource> inputSourceClass()
        Description copied from class: BaseInputSourceDefn
        Overridden by each subclass to return the input source class to be used for JSON conversions.
        Specified by:
        inputSourceClass in class BaseInputSourceDefn
      • partialTableFn

        public TableFunction partialTableFn​(ResolvedExternalTable table)
        Description copied from interface: InputSourceDefn
        Provide 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 for InputSourceDefn.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.
      • validate

        public void validate​(ResolvedExternalTable table)
        Description copied from interface: InputSourceDefn
        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.
        Specified by:
        validate in interface InputSourceDefn
        Overrides:
        validate in class FormattedInputSourceDefn
        Parameters:
        table - a catalog table spec with the input source and input format properties parsed into generic Java maps
      • convertCompletedTable

        protected ExternalTableSpec convertCompletedTable​(ResolvedExternalTable table,
                                                          Map<String,​Object> args,
                                                          List<ColumnSpec> columns)
        Description copied from class: BaseInputSourceDefn
        Complete 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 an EXTENDS clause: the implementation should decide if columns are required (or allowed) depending on whether the partial spec already defines columns.
        Specified by:
        convertCompletedTable in class BaseInputSourceDefn
        Parameters:
        table - the partial table spec, with input source and format parsed into a generic Java map
        args - 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 SQL EXTEND clause
        Returns:
        an external table spec which Calcite can consume