private static LocalQueryRunner createMemoryLocalQueryRunner(Session session) { LocalQueryRunner localQueryRunner = LocalQueryRunner.queryRunnerWithInitialTransaction(session); // add tpch localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of()); localQueryRunner.createCatalog( "memory", new MemoryConnectorFactory(), ImmutableMap.of("memory.max-data-per-node", "4GB")); return localQueryRunner; }
public static LocalQueryRunner createLocalQueryRunner(Map<String, String> extraSessionProperties) { SessionBuilder sessionBuilder = testSessionBuilder() .setCatalog("tpch") .setSchema(TINY_SCHEMA_NAME); extraSessionProperties.forEach(sessionBuilder::setSystemProperty); Session session = sessionBuilder.build(); LocalQueryRunner localQueryRunner = new LocalQueryRunner(session); // add tpch localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of()); return localQueryRunner; } }
private static LocalQueryRunner createQueryRunner(Session session) { LocalQueryRunner queryRunner = new LocalQueryRunner(session); queryRunner.createCatalog(session.getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of()); return queryRunner; }
@BeforeClass public void setUp() { runner = new LocalQueryRunner(TEST_SESSION); runner.createCatalog(TEST_SESSION.getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of()); }
@Setup public void setUp() throws IOException { queryRunner = new LocalQueryRunner(testSessionBuilder() .setCatalog("memory") .setSchema("default") .build()); queryRunner.installPlugin(new GeoPlugin()); queryRunner.createCatalog("memory", new MemoryConnectorFactory(), ImmutableMap.of()); Path path = Paths.get(BenchmarkSpatialJoin.class.getClassLoader().getResource("us-states.tsv").getPath()); String polygonValues = Files.lines(path) .map(line -> line.split("\t")) .map(parts -> format("('%s', '%s')", parts[0], parts[1])) .collect(Collectors.joining(",")); queryRunner.execute(format("CREATE TABLE memory.default.polygons AS SELECT * FROM (VALUES %s) as t (name, wkt)", polygonValues)); }
@Setup public void setUp() throws IOException { queryRunner = new LocalQueryRunner(testSessionBuilder() .setCatalog("memory") .setSchema("default") .build()); queryRunner.installPlugin(new GeoPlugin()); queryRunner.createCatalog("memory", new MemoryConnectorFactory(), ImmutableMap.of()); Path path = Paths.get(BenchmarkGeometryAggregations.class.getClassLoader().getResource("us-states.tsv").getPath()); String polygonValues = Files.lines(path) .map(line -> line.split("\t")) .map(parts -> format("('%s', '%s')", parts[0], parts[1])) .collect(Collectors.joining(",")); queryRunner.execute( format("CREATE TABLE memory.default.us_states AS SELECT ST_GeometryFromText(t.wkt) AS geom FROM (VALUES %s) as t (name, wkt)", polygonValues)); }
private static LocalQueryRunner createQueryRunner() { LocalQueryRunner queryRunner = new LocalQueryRunner(testSessionBuilder() .setCatalog("memory") .setSchema("default") .build()); queryRunner.installPlugin(new GeoPlugin()); queryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of()); queryRunner.createCatalog("memory", new MemoryConnectorFactory(), ImmutableMap.of()); queryRunner.execute(format("CREATE TABLE kdb_tree AS SELECT '%s' AS v", KDB_TREE_JSON)); return queryRunner; }
private static LocalQueryRunner createQueryRunner(Map<String, String> sessionProperties) { Session.SessionBuilder sessionBuilder = testSessionBuilder() .setCatalog("local") .setSchema("tiny") .setSystemProperty("task_concurrency", "1"); // these tests don't handle exchanges from local parallel sessionProperties.entrySet().forEach(entry -> sessionBuilder.setSystemProperty(entry.getKey(), entry.getValue())); LocalQueryRunner queryRunner = new LocalQueryRunner(sessionBuilder.build()); queryRunner.createCatalog(queryRunner.getDefaultSession().getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of()); return queryRunner; }
public static LocalQueryRunner createQueryRunner(Map<String, String> catalogProperties, Class<? extends AtopFactory> factoryClass) { Session session = testSessionBuilder() .setCatalog("atop") .setSchema("default") .setTimeZoneKey(TimeZoneKey.getTimeZoneKey(TimeZone.getDefault().getID())) .build(); LocalQueryRunner queryRunner = new LocalQueryRunner(session); try { AtopConnectorFactory connectorFactory = new AtopConnectorFactory(factoryClass, LocalAtopQueryRunner.class.getClassLoader()); ImmutableMap.Builder<String, String> properties = ImmutableMap.<String, String>builder() .putAll(catalogProperties) .put("atop.max-history-days", "1"); queryRunner.createCatalog("atop", connectorFactory, properties.build()); return queryRunner; } catch (Exception e) { closeAllSuppress(e, queryRunner); throw e; } } }
@BeforeClass public void setUp() { queryRunner = new LocalQueryRunner(testSessionBuilder() .setCatalog("local") .setSchema("tiny") .build()); queryRunner.createCatalog( queryRunner.getDefaultSession().getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of()); }
@Setup public void setup() { String tpch = "tpch"; session = testSessionBuilder() .setCatalog(tpch) .setSchema("sf1") .setSystemProperty("iterative_optimizer_enabled", iterativeOptimizerEnabled) .build(); queryRunner = new LocalQueryRunner(session); queryRunner.createCatalog(tpch, new TpchConnectorFactory(4), ImmutableMap.of(TPCH_COLUMN_NAMING_PROPERTY, ColumnNaming.STANDARD.name())); queries = IntStream.rangeClosed(1, 22) .boxed() .filter(i -> i != 15) // q15 has two queries in it .map(i -> readResource(String.format("/io/airlift/tpch/queries/q%d.sql", i))) .collect(toImmutableList()); }
@BeforeClass public void setUp() { Session defaultSession = testSessionBuilder() .setCatalog("tpcds") .setSchema("sf1") .build(); LocalQueryRunner queryRunner = new LocalQueryRunner(defaultSession); queryRunner.createCatalog("tpcds", new TpcdsConnectorFactory(), emptyMap()); statisticsAssertion = new StatisticsAssertion(queryRunner); }
public TestDictionaryAggregation() { super(() -> { LocalQueryRunner queryRunner = new LocalQueryRunner(testSessionBuilder() .setSystemProperty(DICTIONARY_AGGREGATION, "true") .setSystemProperty(REORDER_JOINS, "false") // no JOIN reordering .build()); queryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of()); return queryRunner; }); }
private LocalQueryRunner createLocalQueryRunner(NodeSpillConfig nodeSpillConfig) { LocalQueryRunner queryRunner = new LocalQueryRunner( SESSION, new FeaturesConfig() .setSpillerSpillPaths(spillPath.getAbsolutePath()) .setSpillEnabled(true), nodeSpillConfig, false, true); queryRunner.createCatalog( SESSION.getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of()); return queryRunner; } }
public TestStatsCalculator() { this.queryRunner = new LocalQueryRunner(testSessionBuilder() .setCatalog("local") .setSchema("tiny") .setSystemProperty("task_concurrency", "1") // these tests don't handle exchanges from local parallel .build()); queryRunner.createCatalog( queryRunner.getDefaultSession().getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of()); }
@BeforeClass public void setUp() { Session.SessionBuilder sessionBuilder = testSessionBuilder() .setCatalog("local") .setSchema("tiny") .setSystemProperty("task_concurrency", "1") .setSystemProperty("iterative_optimizer_enabled", "true") .setSystemProperty("iterative_optimizer_timeout", "1ms"); queryRunner = new LocalQueryRunner(sessionBuilder.build()); queryRunner.createCatalog(queryRunner.getDefaultSession().getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of()); }
@BeforeClass public void setUp() { Session defaultSession = testSessionBuilder() .setCatalog("tpch") .setSchema(TINY_SCHEMA_NAME) // We are not able to calculate stats for PARTIAL aggregations .setSystemProperty(PREFER_PARTIAL_AGGREGATION, "false") .build(); LocalQueryRunner queryRunner = new LocalQueryRunner(defaultSession); queryRunner.createCatalog( "tpch", new TpchConnectorFactory(1), ImmutableMap.of(TPCH_COLUMN_NAMING_PROPERTY, ColumnNaming.STANDARD.name())); statisticsAssertion = new StatisticsAssertion(queryRunner); }
@Setup public void setup() { Session session = testSessionBuilder() .setSystemProperty("join_reordering_strategy", joinReorderingStrategy) .setSystemProperty("join_distribution_type", "AUTOMATIC") .setCatalog("tpch") .setSchema("tiny") .build(); queryRunner = new LocalQueryRunner(session); queryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of()); }
public TestTpcdsCostBasedPlan() { super(() -> { String catalog = "local"; Session.SessionBuilder sessionBuilder = testSessionBuilder() .setCatalog(catalog) .setSchema("sf3000.0") .setSystemProperty("task_concurrency", "1") // these tests don't handle exchanges from local parallel .setSystemProperty(JOIN_REORDERING_STRATEGY, JoinReorderingStrategy.AUTOMATIC.name()) .setSystemProperty(JOIN_DISTRIBUTION_TYPE, JoinDistributionType.AUTOMATIC.name()); LocalQueryRunner queryRunner = LocalQueryRunner.queryRunnerWithFakeNodeCountForStats(sessionBuilder.build(), 8); queryRunner.createCatalog( catalog, new TpcdsConnectorFactory(1), ImmutableMap.of()); return queryRunner; }); }
public TestTpchCostBasedPlan() { super(() -> { String catalog = "local"; SessionBuilder sessionBuilder = testSessionBuilder() .setCatalog(catalog) .setSchema("sf3000.0") .setSystemProperty("task_concurrency", "1") // these tests don't handle exchanges from local parallel .setSystemProperty(JOIN_REORDERING_STRATEGY, JoinReorderingStrategy.AUTOMATIC.name()) .setSystemProperty(JOIN_DISTRIBUTION_TYPE, JoinDistributionType.AUTOMATIC.name()); LocalQueryRunner queryRunner = LocalQueryRunner.queryRunnerWithFakeNodeCountForStats(sessionBuilder.build(), 8); queryRunner.createCatalog( catalog, new TpchConnectorFactory(1, false, false), ImmutableMap.of(TPCH_COLUMN_NAMING_PROPERTY, ColumnNaming.SIMPLIFIED.name())); return queryRunner; }); }