Search in sources :

Example 11 with Planner

use of org.apache.flink.table.delegation.Planner in project flink by apache.

the class StreamTableEnvironmentImpl method create.

public static StreamTableEnvironment create(StreamExecutionEnvironment executionEnvironment, EnvironmentSettings settings, TableConfig tableConfig) {
    // temporary solution until FLINK-15635 is fixed
    final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    final ModuleManager moduleManager = new ModuleManager();
    final CatalogManager catalogManager = CatalogManager.newBuilder().classLoader(classLoader).config(tableConfig.getConfiguration()).defaultCatalog(settings.getBuiltInCatalogName(), new GenericInMemoryCatalog(settings.getBuiltInCatalogName(), settings.getBuiltInDatabaseName())).executionConfig(executionEnvironment.getConfig()).build();
    final FunctionCatalog functionCatalog = new FunctionCatalog(tableConfig, catalogManager, moduleManager);
    final Executor executor = lookupExecutor(classLoader, settings.getExecutor(), executionEnvironment);
    final Planner planner = PlannerFactoryUtil.createPlanner(settings.getPlanner(), executor, tableConfig, moduleManager, catalogManager, functionCatalog);
    return new StreamTableEnvironmentImpl(catalogManager, moduleManager, functionCatalog, tableConfig, executionEnvironment, planner, executor, settings.isStreamingMode(), classLoader);
}
Also used : FunctionCatalog(org.apache.flink.table.catalog.FunctionCatalog) Executor(org.apache.flink.table.delegation.Executor) Planner(org.apache.flink.table.delegation.Planner) ModuleManager(org.apache.flink.table.module.ModuleManager) AbstractStreamTableEnvironmentImpl(org.apache.flink.table.api.bridge.internal.AbstractStreamTableEnvironmentImpl) CatalogManager(org.apache.flink.table.catalog.CatalogManager) GenericInMemoryCatalog(org.apache.flink.table.catalog.GenericInMemoryCatalog)

Aggregations

Planner (org.apache.flink.table.delegation.Planner)11 Executor (org.apache.flink.table.delegation.Executor)10 CatalogManager (org.apache.flink.table.catalog.CatalogManager)7 FunctionCatalog (org.apache.flink.table.catalog.FunctionCatalog)7 ModuleManager (org.apache.flink.table.module.ModuleManager)7 TableConfig (org.apache.flink.table.api.TableConfig)6 Constructor (java.lang.reflect.Constructor)5 StreamExecutionEnvironment (org.apache.flink.streaming.api.environment.StreamExecutionEnvironment)5 TableEnvironment (org.apache.flink.table.api.TableEnvironment)5 TableException (org.apache.flink.table.api.TableException)5 EnvironmentSettings (org.apache.flink.table.api.EnvironmentSettings)3 GenericInMemoryCatalog (org.apache.flink.table.catalog.GenericInMemoryCatalog)2 PlannerFactory (org.apache.flink.table.delegation.PlannerFactory)2 AttributedString (org.jline.utils.AttributedString)2 AbstractStreamTableEnvironmentImpl (org.apache.flink.table.api.bridge.internal.AbstractStreamTableEnvironmentImpl)1 ExecutorFactory (org.apache.flink.table.delegation.ExecutorFactory)1