Class Frameworks

java.lang.Object
org.apache.calcite.tools.Frameworks

public class Frameworks extends Object
Tools for invoking Calcite functionality without initializing a container / server first.
  • Method Details

    • getPlanner

      public static Planner getPlanner(FrameworkConfig config)
      Creates a planner.
      Parameters:
      config - Planner configuration
      Returns:
      Planner
    • withPlanner

      public static <R> R withPlanner(Frameworks.PlannerAction<R> action, FrameworkConfig config)
      Initializes a container then calls user-specified code with a planner.
      Parameters:
      action - Callback containing user-specified code
      config - FrameworkConfig to use for planner action.
      Returns:
      Return value from action
    • withPlanner

      public static <R> R withPlanner(Frameworks.PlannerAction<R> action)
      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 public static <R> R withPrepare(Frameworks.PrepareAction<R> action)
      Deprecated.
    • withPrepare

      public static <R> R withPrepare(Frameworks.BasePrepareAction<R> action)
      As withPrepare(FrameworkConfig, BasePrepareAction) but using a default configuration.
    • withPrepare

      public static <R> R withPrepare(FrameworkConfig config, Frameworks.BasePrepareAction<R> action)
      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

      public static SchemaPlus createRootSchema(boolean addMetadataSchema)
      Creates a root schema.
      Parameters:
      addMetadataSchema - Whether to add "metadata" schema containing definitions of tables, columns etc.
    • newConfigBuilder

      public static Frameworks.ConfigBuilder newConfigBuilder()
      Creates a config builder with each setting initialized to its default value.
    • newConfigBuilder

      public static Frameworks.ConfigBuilder newConfigBuilder(FrameworkConfig config)
      Creates a config builder initializing each setting from an existing config.

      So, newConfigBuilder(config).build() will return a value equal to config.