Search in sources :

Example 1 with CoreModule

use of org.apache.flink.table.module.CoreModule in project flink by apache.

the class CoreModuleFactoryTest method test.

@Test
public void test() {
    final CoreModule expectedModule = CoreModule.INSTANCE;
    final Module actualModule = FactoryUtil.createModule(CoreModuleFactory.IDENTIFIER, Collections.emptyMap(), new Configuration(), Thread.currentThread().getContextClassLoader());
    assertEquals(expectedModule, actualModule);
}
Also used : Configuration(org.apache.flink.configuration.Configuration) CoreModule(org.apache.flink.table.module.CoreModule) Module(org.apache.flink.table.module.Module) CoreModule(org.apache.flink.table.module.CoreModule) Test(org.junit.Test)

Example 2 with CoreModule

use of org.apache.flink.table.module.CoreModule in project flink by apache.

the class HiveDialectQueryITCase method getTableEnvWithHiveCatalog.

private static TableEnvironment getTableEnvWithHiveCatalog() {
    TableEnvironment tableEnv = HiveTestUtils.createTableEnvInBatchMode(SqlDialect.HIVE);
    tableEnv.registerCatalog(hiveCatalog.getName(), hiveCatalog);
    tableEnv.useCatalog(hiveCatalog.getName());
    // automatically load hive module in hive-compatible mode
    HiveModule hiveModule = new HiveModule(hiveCatalog.getHiveVersion());
    CoreModule coreModule = CoreModule.INSTANCE;
    for (String loaded : tableEnv.listModules()) {
        tableEnv.unloadModule(loaded);
    }
    tableEnv.loadModule("hive", hiveModule);
    tableEnv.loadModule("core", coreModule);
    return tableEnv;
}
Also used : HiveModule(org.apache.flink.table.module.hive.HiveModule) TableEnvironment(org.apache.flink.table.api.TableEnvironment) CoreModule(org.apache.flink.table.module.CoreModule)

Aggregations

CoreModule (org.apache.flink.table.module.CoreModule)2 Configuration (org.apache.flink.configuration.Configuration)1 TableEnvironment (org.apache.flink.table.api.TableEnvironment)1 Module (org.apache.flink.table.module.Module)1 HiveModule (org.apache.flink.table.module.hive.HiveModule)1 Test (org.junit.Test)1