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
Modifier and TypeClassDescriptionstatic interface
Piece of code to be run in a context where a planner and statement are available.static class
A builder to help you build aFrameworkConfig
using defaults where values aren't required.static interface
Piece of code to be run in a context where a planner is available.static class
Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic SchemaPlus
createRootSchema
(boolean addMetadataSchema) Creates a root schema.static Planner
getPlanner
(FrameworkConfig config) Creates a planner.static Frameworks.ConfigBuilder
Creates a config builder with each setting initialized to its default value.static Frameworks.ConfigBuilder
newConfigBuilder
(FrameworkConfig config) Creates a config builder initializing each setting from an existing config.static <R> R
withPlanner
(Frameworks.PlannerAction<R> action) Initializes a container then calls user-specified code with a planner.static <R> R
withPlanner
(Frameworks.PlannerAction<R> action, FrameworkConfig config) Initializes a container then calls user-specified code with a planner.static <R> R
withPrepare
(FrameworkConfig config, Frameworks.BasePrepareAction<R> action) Initializes a container then calls user-specified code with a planner and statement.static <R> R
withPrepare
(Frameworks.BasePrepareAction<R> action) AswithPrepare(FrameworkConfig, BasePrepareAction)
but using a default configuration.static <R> R
withPrepare
(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
.
-