Re: How to use TableEnvironment in multiple thread environments

2022-01-19 Thread Till Rohrmann
Hi Chang, I think the TableEnvironment is not designed to be used by multiple threads. If you want to share state between the different instances, then you have to either duplicate this information or put a synchronization mechanism into place (e.g. by creating a thread safe CatalogManager or

Re: How to use TableEnvironment in multiple thread environments

2022-01-18 Thread Chang Chen
Thanks Till. If so, how does Flink share Catalog data between threads? I didn't find any synchronized codes in CatalogManager. Does it mean we can only share catalogs through an external hive meta store? BR - Chang Till Rohrmann 于2022年1月17日周一 17:26写道: > Hi Chang, > > Yes, I think this would

Re: How to use TableEnvironment in multiple thread environments

2022-01-17 Thread Till Rohrmann
Hi Chang, Yes, I think this would make most sense to do. Cheers, Till On Mon, Jan 17, 2022 at 9:13 AM Chang Chen wrote: > IIUC, TableEnvironment isn't thread-safe, since it contains some internal > states, for example, PlannerContext that has RelOptCluster used to optimize > SQL. > > So do I

How to use TableEnvironment in multiple thread environments

2022-01-17 Thread Chang Chen
IIUC, TableEnvironment isn't thread-safe, since it contains some internal states, for example, PlannerContext that has RelOptCluster used to optimize SQL. So do I create a TableEnvironment per thread?