Package org.apache.calcite.model
Class ModelHandler
java.lang.Object
org.apache.calcite.model.ModelHandler
Reads a model and creates schema objects accordingly.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumExtra operands automatically injected into aJsonCustomSchema.operand, as extra context for the adapter. -
Constructor Summary
ConstructorsConstructorDescriptionModelHandler(CalciteConnection connection, String uri) Deprecated.ModelHandler(SchemaPlus rootSchema, String uri) Creates aModelHandlerthat uses the standard class-name filter.ModelHandler(SchemaPlus rootSchema, String uri, org.apache.calcite.model.ClassNameFilter classNameFilter) Creates aModelHandlerthat validates every class loaded by reflection from the model againstclassNameFilter. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddFunctions(org.apache.calcite.model.ClassNameFilter filter, SchemaPlus schema, @Nullable String functionName, String className, @Nullable String methodName, boolean upCase) Creates and validates aScalarFunctionImpland adds it to a schema, after askingfilterto acceptclassName.static voidaddFunctions(SchemaPlus schema, @Nullable String functionName, List<String> unusedPath, String className, @Nullable String methodName, boolean upCase) Creates and validates aScalarFunctionImpl, and adds it to a schema, using the standard class-name filter.static voidcreate(SchemaPlus schema, String functionName, List<String> path, String className, String methodName) Deprecated.@Nullable StringoperandMap(@Nullable JsonSchema jsonSchema, @Nullable Map<String, Object> operand) Adds extra entries to an operand to a custom schema.voidvisit(JsonColumn jsonColumn) voidvisit(JsonCustomSchema jsonSchema) voidvisit(JsonCustomTable jsonTable) voidvisit(JsonFunction jsonFunction) voidvisit(JsonJdbcSchema jsonSchema) voidvisit(JsonLattice jsonLattice) voidvisit(JsonMapSchema jsonSchema) voidvisit(JsonMaterialization jsonMaterialization) voidvisit(JsonMeasure jsonMeasure) voidvoidvoidvoid
-
Constructor Details
-
ModelHandler
Creates aModelHandlerthat uses the standard class-name filter.- Throws:
IOException
-
ModelHandler
public ModelHandler(SchemaPlus rootSchema, String uri, org.apache.calcite.model.ClassNameFilter classNameFilter) throws IOException Creates aModelHandlerthat validates every class loaded by reflection from the model againstclassNameFilter. Use this to apply a stricter (or more permissive) filter than the standard one.- Throws:
IOException
-
ModelHandler
Deprecated.- Throws:
IOException
-
-
Method Details
-
create
@Deprecated public static void create(SchemaPlus schema, String functionName, List<String> path, String className, String methodName) -
addFunctions
public static void addFunctions(SchemaPlus schema, @Nullable String functionName, List<String> unusedPath, String className, @Nullable String methodName, boolean upCase) Creates and validates aScalarFunctionImpl, and adds it to a schema, using the standard class-name filter. Kept for backwards compatibility; prefer the filter-taking overload ofaddFunctions, which lets callers supply their own filter.If
methodNameis "*", may add more than one function.- Parameters:
schema- Schema to add tofunctionName- Name of function; null to derived from method nameunusedPath- Path to look for functions (currently ignored)className- Class to inspect for methods that may be user-defined functionsmethodName- Method name; null means use the class as a UDF; "*" means add all methodsupCase- Whether to convert method names to upper case, so that they can be called without using quotes
-
addFunctions
public static void addFunctions(org.apache.calcite.model.ClassNameFilter filter, SchemaPlus schema, @Nullable String functionName, String className, @Nullable String methodName, boolean upCase) Creates and validates aScalarFunctionImpland adds it to a schema, after askingfilterto acceptclassName. -
visit
-
visit
-
visit
-
operandMap
protected Map<String,Object> operandMap(@Nullable JsonSchema jsonSchema, @Nullable Map<String, Object> operand) Adds extra entries to an operand to a custom schema. -
visit
-
visit
-
visit
-
visit
-
visit
-
visit
-
defaultSchemaName
-
visit
-
visit
-
visit
-
visit
-
addFunctions(org.apache.calcite.schema.SchemaPlus, java.lang.String, java.util.List<java.lang.String>, java.lang.String, java.lang.String, boolean).