Interface TableFunction
- All Known Implementing Classes:
BaseInputSourceDefn.AdHocTableFunction,BaseInputSourceDefn.PartialTableFunction,BaseTableFunction
public interface TableFunction
Representation of a SQL table function. The SQL module is not visible here.
To avoid unnecessary dependencies, this class provides the information that
Calcite needs, but without Calcite dependencies. Each function defines some
number of arguments needed to create an external table. This same class
can define a "from scratch" table, or to convert a partial table definition
in the catalog into a full-defined external table.
The parameters tell Calcite the allowed parameters. Functions created from
this class are most useful when used with named arguments:
SELECT ... FROM TABLE(thisFn(foo -> "bar", answer -> 42))
</pre
Calcite provides actual arguments as an array, with null values for arguments
which the user did not provide. That form is not helpful for this use case.
The caller converts those a map, with only the actual arguments set. The
call also provides a row schema, obtained from the Calcite EXTEND
extension. The result is an ExternalTableSpec which the caller uses
to create the Calcite form of an external table.
-
Method Details
-
parameters
List<TableFunction.ParameterDefn> parameters() -
apply
ExternalTableSpec apply(String fnName, Map<String, Object> args, List<ColumnSpec> columns, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
-