Class Frameworks


  • public class Frameworks
    extends java.lang.Object
    Tools for invoking Calcite functionality without initializing a container / server first.
    • Constructor Detail

      • Frameworks

        private Frameworks()
    • Method Detail

      • 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

        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.