Package org.apache.calcite.tools
Class Frameworks
java.lang.Object
org.apache.calcite.tools.Frameworks
Tools for invoking Calcite functionality without initializing a container /
server first.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacePiece of code to be run in a context where a planner and statement are available.static classA builder to help you build aFrameworkConfigusing defaults where values aren't required.static interfacePiece of code to be run in a context where a planner is available.static classDeprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic SchemaPluscreateRootSchema(boolean addMetadataSchema) Creates a root schema.static PlannergetPlanner(FrameworkConfig config) Creates a planner.static Frameworks.ConfigBuilderCreates a config builder with each setting initialized to its default value.static Frameworks.ConfigBuildernewConfigBuilder(FrameworkConfig config) Creates a config builder initializing each setting from an existing config.static <R> RwithPlanner(Frameworks.PlannerAction<R> action) Initializes a container then calls user-specified code with a planner.static <R> RwithPlanner(Frameworks.PlannerAction<R> action, FrameworkConfig config) Initializes a container then calls user-specified code with a planner.static <R> RwithPrepare(FrameworkConfig config, Frameworks.BasePrepareAction<R> action) Initializes a container then calls user-specified code with a planner and statement.static <R> RwithPrepare(Frameworks.BasePrepareAction<R> action) AswithPrepare(FrameworkConfig, BasePrepareAction)but using a default configuration.static <R> RwithPrepare(Frameworks.PrepareAction<R> action) Deprecated.
-
Method Details
-
getPlanner
Creates a planner.- Parameters:
config- Planner configuration- Returns:
- Planner
-
withPlanner
Initializes a container then calls user-specified code with a planner.- Parameters:
action- Callback containing user-specified codeconfig- FrameworkConfig to use for planner action.- Returns:
- Return value from action
-
withPlanner
Initializes a container then calls user-specified code with a planner.- Parameters:
action- Callback containing user-specified code- Returns:
- Return value from action
-
withPrepare
Deprecated. -
withPrepare
AswithPrepare(FrameworkConfig, BasePrepareAction)but using a default configuration. -
withPrepare
Initializes a container then calls user-specified code with a planner and statement.- Parameters:
action- Callback containing user-specified code- Returns:
- Return value from action
-
createRootSchema
Creates a root schema.- Parameters:
addMetadataSchema- Whether to add "metadata" schema containing definitions of tables, columns etc.
-
newConfigBuilder
Creates a config builder with each setting initialized to its default value. -
newConfigBuilder
Creates a config builder initializing each setting from an existing config.So,
newConfigBuilder(config).build()will return a value equal toconfig.
-