Interface TableFunction
-
- All Known Implementing Classes:
BaseInputSourceDefn.AdHocTableFunction,BaseInputSourceDefn.PartialTableFunction,BaseTableFunction
public interface TableFunctionRepresentation 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))
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
EXTENDextension. The result is anExternalTableSpecwhich the caller uses to create the Calcite form of an external table.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceTableFunction.ParameterDefnstatic classTableFunction.ParameterType
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExternalTableSpecapply(String fnName, Map<String,Object> args, List<ColumnSpec> columns, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)List<TableFunction.ParameterDefn>parameters()
-
-
-
Method Detail
-
parameters
List<TableFunction.ParameterDefn> parameters()
-
apply
ExternalTableSpec apply(String fnName, Map<String,Object> args, List<ColumnSpec> columns, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
-
-