[ 
https://issues.apache.org/jira/browse/FLINK-33784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17794746#comment-17794746
 ] 

Timo Walther commented on FLINK-33784:
--------------------------------------

What is required is this:
{code}
        final MutableURLClassLoader userClassLoader =
                FlinkUserCodeClassLoaders.create(
                        new URL[0], settings.getUserClassLoader(), 
settings.getConfiguration());

        final ExecutorFactory executorFactory =
                FactoryUtil.discoverFactory(
                        userClassLoader, ExecutorFactory.class, 
ExecutorFactory.DEFAULT_IDENTIFIER);
        final Executor executor = 
executorFactory.create(settings.getConfiguration());

        // use configuration to init table config
        final TableConfig tableConfig = TableConfig.getDefault();
        tableConfig.setRootConfiguration(executor.getConfiguration());
        tableConfig.addConfiguration(settings.getConfiguration());

        final CatalogStoreFactory catalogStoreFactory =
                TableFactoryUtil.findAndCreateCatalogStoreFactory(
                        tableConfig, userClassLoader);
        final CatalogStoreFactory.Context context =
                TableFactoryUtil.buildCatalogStoreFactoryContext(
                        tableConfig, userClassLoader);
        catalogStoreFactory.open(context);
        final CatalogStore catalogStore =
                settings.getCatalogStore() != null
                        ? settings.getCatalogStore()
                        : catalogStoreFactory.createCatalogStore();
{code}

Unfortunately, this requires some work in downstream code to deal with 
`ReadableConfig` instead of Configuration. 

> CatalogStoreFactory can not be configured via StreamExecutionEnvironment
> ------------------------------------------------------------------------
>
>                 Key: FLINK-33784
>                 URL: https://issues.apache.org/jira/browse/FLINK-33784
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table SQL / API
>            Reporter: Timo Walther
>            Assignee: Timo Walther
>            Priority: Major
>
> The logic in TableEnvironment.create() has well-defined ordering which allows 
> to configure most settings via StreamExecutionEnvironment and 
> flink-conf.yaml. The discovery of CatalogStoreFactory should be postponed 
> until the final configuration is merged.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to