@Override public <T> List<T> getServices(Class<T> type) { if (type == FunctionFactory.class) { return ImmutableList.of(type.cast(new UdfFactory(typeManager))); } return ImmutableList.of(); }
@Override public <T> List<T> getServices(Class<T> type) { if(type == FunctionFactory.class) { try { Map<String, String> properties = new ConfigurationLoader().loadPropertiesFrom("etc/plugin/viterbi.properties"); ViterbiConfig config = new ViterbiConfig(properties); return ImmutableList.of(type.cast(new ViterbiFunctionFactory(typeManager, config))); } catch (Exception e) { e.printStackTrace(); } } return ImmutableList.of(); }
@Override public <T> List<T> getServices(Class<T> type) { if (type == FunctionFactory.class) { return ImmutableList.of(type.cast(new MLFunctionFactory(typeManager))); } else if (type == Type.class) { return ImmutableList.of(type.cast(MODEL), type.cast(REGRESSOR)); } else if (type == ParametricType.class) { return ImmutableList.of(type.cast(new ClassifierParametricType())); } return ImmutableList.of(); }
private static LocalQueryRunner createLocalQueryRunner() { Session defaultSession = testSessionBuilder() .setCatalog("local") .setSchema(TINY_SCHEMA_NAME) .build(); LocalQueryRunner localQueryRunner = new LocalQueryRunner(defaultSession); // add the tpch catalog // local queries run directly against the generator localQueryRunner.createCatalog( defaultSession.getCatalog().get(), new TpchConnectorFactory(localQueryRunner.getNodeManager(), 1), ImmutableMap.<String, String>of()); MLPlugin plugin = new MLPlugin(); plugin.setTypeManager(localQueryRunner.getTypeManager()); for (Type type : plugin.getServices(Type.class)) { localQueryRunner.getTypeManager().addType(type); } for (ParametricType parametricType : plugin.getServices(ParametricType.class)) { localQueryRunner.getTypeManager().addParametricType(parametricType); } localQueryRunner.getMetadata().getFunctionRegistry().addFunctions(Iterables.getOnlyElement(plugin.getServices(FunctionFactory.class)).listFunctions()); return localQueryRunner; }
@Override public <T> List<T> getServices(Class<T> type) { if (type == FunctionFactory.class) { return ImmutableList.of(type.cast(new TeradataFunctionFactory(typeManager))); } return ImmutableList.of(); }