@Test public void testDatabases() throws Exception { final String hiveCatalog = "hivecatalog"; final ExecutionContext<?> context = createCatalogExecutionContext(); final TableEnvironment tableEnv = context.createEnvironmentInstance().getTableEnvironment(); assertEquals(1, tableEnv.listDatabases().length); assertEquals("mydatabase", tableEnv.listDatabases()[0]); tableEnv.useCatalog(hiveCatalog); assertEquals(2, tableEnv.listDatabases().length); assertEquals( new HashSet<>( Arrays.asList( HiveCatalog.DEFAULT_DB, DependencyTest.TestHiveCatalogFactory.ADDITIONAL_TEST_DATABASE) ), new HashSet<>(Arrays.asList(tableEnv.listDatabases())) ); tableEnv.useCatalog(hiveCatalog); assertEquals(HiveCatalog.DEFAULT_DB, tableEnv.getCurrentDatabase()); tableEnv.useDatabase(DependencyTest.TestHiveCatalogFactory.ADDITIONAL_TEST_DATABASE); assertEquals(DependencyTest.TestHiveCatalogFactory.ADDITIONAL_TEST_DATABASE, tableEnv.getCurrentDatabase()); }
public EnvironmentInstance createEnvironmentInstance() { try { return wrapClassLoader(EnvironmentInstance::new); } catch (Throwable t) { throw new SqlExecutionException("Could not create environment instance.", t); } }
ExecutionContext { public EnvironmentInstance createEnvironmentInstance() { try { return wrapClassLoader(EnvironmentInstance::new); } catch (Throwable t) { throw new SqlExecutionException("Could not create environment instance.", t); } } }
ExecutionContext { public EnvironmentInstance createEnvironmentInstance() { try { return wrapClassLoader(EnvironmentInstance::new); } catch (Throwable t) { throw new SqlExecutionException("Could not create environment instance.", t); } } ExecutionContext(Environment defaultEnvironment, SessionContext sessionContext, List<URL> dependencies,
			Configuration flinkConfig, Options commandLineOptions, List<CustomCommandLine<?>> availableCommandLines); }
ExecutionContext { public EnvironmentInstance createEnvironmentInstance() { try { return wrapClassLoader(EnvironmentInstance::new); } catch (Throwable t) { throw new SqlExecutionException("Could not create environment instance.", t); } } ExecutionContext(Environment defaultEnvironment, SessionContext sessionContext, List<URL> dependencies,
			Configuration flinkConfig, Options commandLineOptions, List<CustomCommandLine<?>> availableCommandLines); SessionContext getSessionContext(); ClassLoader getClassLoader(); Environment getMergedEnvironment(); ClusterSpecification getClusterSpec(); T getClusterId(); ClusterDescriptor<T> createClusterDescriptor(); EnvironmentInstance createEnvironmentInstance(); Map<String, Catalog> getCatalogs(); Map<String, TableSource<?>> getTableSources(); Map<String, TableSink<?>> getTableSinks(); R wrapClassLoader(Supplier<R> supplier); }
ExecutionContext { public EnvironmentInstance createEnvironmentInstance() { try { return wrapClassLoader(EnvironmentInstance::new); } catch (Throwable t) { throw new SqlExecutionException("Could not create environment instance.", t); } } ExecutionContext(Environment defaultEnvironment, SessionContext sessionContext, List<URL> dependencies,
			Configuration flinkConfig, Options commandLineOptions, List<CustomCommandLine<?>> availableCommandLines); SessionContext getSessionContext(); ClassLoader getClassLoader(); Environment getMergedEnvironment(); ClusterSpecification getClusterSpec(); T getClusterId(); ClusterDescriptor<T> createClusterDescriptor(); EnvironmentInstance createEnvironmentInstance(); Map<String, Catalog> getCatalogs(); Map<String, TableSource<?>> getTableSources(); Map<String, TableSink<?>> getTableSinks(); R wrapClassLoader(Supplier<R> supplier);  }