super(createLocalQueryRunner(), createDefaultSampledSession());
}
private static LocalQueryRunner createLocalQueryRunner()
{
Session defaultSession = Session.builder()
.setUser("user")
.setSource("test")
.setCatalog("local")
.setSchema(TINY_SCHEMA_NAME)
.setTimeZoneKey(UTC_KEY)
.setLocale(ENGLISH)
.build();
LocalQueryRunner localQueryRunner = new LocalQueryRunner(defaultSession);
// add the tpch catalog
// local queries run directly against the generator
localQueryRunner.createCatalog(
defaultSession.getCatalog(),
new TpchConnectorFactory(localQueryRunner.getNodeManager(), 1),
ImmutableMap.<String, String>of());
localQueryRunner.createCatalog(TPCH_SAMPLED_SCHEMA, new SampledTpchConnectorFactory(localQueryRunner.getNodeManager(), 1, 2), ImmutableMap.<String, String>of());
localQueryRunner.getMetadata().addFunctions(CUSTOM_FUNCTIONS);