public abstract class BaseInputSourceDefn extends Object implements InputSourceDefn
FormattedInputSourceDefn} for the base class for (most) input formats
which take an input format.| Modifier and Type | Class and Description |
|---|---|
class |
BaseInputSourceDefn.AdHocTableFunction
The "from-scratch" table function for this input source.
|
class |
BaseInputSourceDefn.PartialTableFunction
The "partial" table function that starts with a catalog external table spec, then
uses SQL function arguments to "complete" (i.e.
|
| Constructor and Description |
|---|
BaseInputSourceDefn() |
| Modifier and Type | Method and Description |
|---|---|
TableFunction |
adHocTableFn()
Provide a definition for a SQL table function that defines an ad-hoc external
table "from scratch" for this input source.
|
protected void |
auditInputSource(Map<String,Object> jsonMap)
Optional step to audit or adjust the input source properties prior to
conversion via Jackson.
|
void |
bind(TableDefnRegistry registry)
Gather information about the set of format definitions.
|
protected InputFormat |
convertArgsToFormat(Map<String,Object> args,
List<ColumnSpec> columns,
com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
Convert SQL arguments, and the column schema, to an input format, if required.
|
protected InputSource |
convertArgsToSource(Map<String,Object> args,
com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
Convert the input source using arguments to a "from scratch" table function.
|
protected abstract void |
convertArgsToSourceMap(Map<String,Object> jsonMap,
Map<String,Object> args)
Convert SQL arguments to the corresponding "generic JSON" form in the given map.
|
protected ExternalTableSpec |
convertArgsToTable(Map<String,Object> args,
List<ColumnSpec> columns,
com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
Define a table "from scratch" using SQL function arguments.
|
protected abstract ExternalTableSpec |
convertCompletedTable(ResolvedExternalTable table,
Map<String,Object> args,
List<ColumnSpec> columns)
Complete a partial table using the table function arguments and columns provided.
|
protected InputSource |
convertSource(Map<String,Object> jsonMap,
com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
Convert from a generic Java map to the target input source using the object
mapper provided.
|
ExternalTableSpec |
convertTable(ResolvedExternalTable table)
Convert a complete (that is, fully-defined) table spec to an external table spec.
|
protected abstract InputFormat |
convertTableToFormat(ResolvedExternalTable table)
Convert the format spec, if any, to an input format.
|
protected InputSource |
convertTableToSource(ResolvedExternalTable table)
Converts the input source given in a table spec.
|
protected abstract BaseInputSourceDefn.AdHocTableFunction |
defineAdHocTableFunction()
Overridden by each subclass to define the parameters needed by each
input source.
|
protected abstract Class<? extends InputSource> |
inputSourceClass()
Overridden by each subclass to return the input source class to be
used for JSON conversions.
|
protected List<ColumnSpec> |
selectPartialTableColumns(ResolvedExternalTable table,
List<ColumnSpec> columns)
Choose table or SQL-provided columns: table takes precedence.
|
void |
validate(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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpartialTableFn, typeValueprotected abstract Class<? extends InputSource> inputSourceClass()
public void bind(TableDefnRegistry registry)
InputSourceDefnbind in interface InputSourceDefnpublic void validate(ResolvedExternalTable table)
InputSourceDefnvalidate in interface InputSourceDefntable - a catalog table spec with the input source and input format
properties parsed into generic Java mapsprotected abstract BaseInputSourceDefn.AdHocTableFunction defineAdHocTableFunction()
public TableFunction adHocTableFn()
InputSourceDefnadHocTableFn in interface InputSourceDefnprotected ExternalTableSpec convertArgsToTable(Map<String,Object> args, List<ColumnSpec> columns, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
protected InputSource convertArgsToSource(Map<String,Object> args, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
protected abstract void convertArgsToSourceMap(Map<String,Object> jsonMap, Map<String,Object> args)
protected InputFormat convertArgsToFormat(Map<String,Object> args, List<ColumnSpec> columns, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
protected abstract ExternalTableSpec convertCompletedTable(ResolvedExternalTable table, Map<String,Object> args, List<ColumnSpec> columns)
EXTENDS clause: the implementation should decide
if columns are required (or allowed) depending on whether the partial spec already
defines columns.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 SQL EXTEND clausepublic ExternalTableSpec convertTable(ResolvedExternalTable table)
InputSourceDefnFROM
clause without using a table function.convertTable in interface InputSourceDefnprotected InputSource convertTableToSource(ResolvedExternalTable table)
table - the resolved external table specprotected InputSource convertSource(Map<String,Object> jsonMap, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
protected void auditInputSource(Map<String,Object> jsonMap)
jsonMap.protected abstract InputFormat convertTableToFormat(ResolvedExternalTable table)
protected List<ColumnSpec> selectPartialTableColumns(ResolvedExternalTable table, List<ColumnSpec> columns)
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.